Improve reliability and use of feature flag testing.

Review Request #11054 — Created June 24, 2020 and submitted

Information

Djblets
release-1.0.x

Reviewers

override_feature_check() and override_feature_checks() weren't
properly cleaning up after a crash or assertion, causing a feature flag
to stay to stay modified after use, potentially disrupting other tests.

This change fixes that by ensuring we clear the state in a finally
clause.

It also improves these methods by allowing a Feature instance to be
passed instead of just its ID, which simplifies usage.

Unit tests pass.

Summary ID
Improve reliability and use of feature flag testing.
`override_feature_check()` and `override_feature_checks()` weren't properly cleaning up after a crash or assertion, causing a feature flag to stay to stay modified after use, potentially disrupting other tests. This change fixes that by ensuring we clear the state in a `finally` clause. It also improves these methods by allowing a `Feature` instance to be passed instead of just its ID, which simplifies usage.
0bbdbecce239e8b55be482b9d9b0bbe7ffd0a542
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-1.0.x (c8dcafb)
Loading...