forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: 44be4da 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/
- Loading branch information
Showing
38 changed files
with
835 additions
and
797 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.