Ran
|
Jobs
7
|
Files
0
|
Run time
–
|
Badge
Embed ▾
README BADGES
|
push
travis-ci
Deprecate the `subsystem_instance` utility function. It was implemented as a contextmanager that resets subsystem state in __exit__. However this interacts badly with tests that use that state (sometimes without even realizing it) outside the subsystem_instance context. Several tests have to do weird balancing acts to get around this. Instead we introduce a global_subsystem_instance() that simply inits and returns the global instance of a subsystem. Test code can rely on our standard test base classes for cleanup between tests, or it can reset subsystem state itself if it needs to do so mid-test. This change allows us to remove various wrapper contextmanagers sprinkled around our tests, and generally supports simplification of several tests. This is part 2 of my effort to simplify and standardize how we create subsystems in tests. See for part 1: 44be4da8b Note to reviewers: The diff is a little hairy, but the focus is on the change in tests/python/pants_test/subsystem/subsystem_util.py. The rest is just modifying all relevant tests to use the new method, and the proof of the validity of those is mostly that the tests pass... Testing Done: CI passes: https://travis-ci.org/pantsbuild/pants/builds/159169092 Reviewed at https://rbcommons.com/s/twitter/r/4220/
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|