enthought / envisage

Envisage is a Python-based framework for building applications whose functionalities can be extended by adding "plug-ins".
http://docs.enthought.com/envisage/
Other
82 stars 26 forks source link

Fix a test that only passed due to test interactions #443

Closed mdickinson closed 3 years ago

mdickinson commented 3 years ago

Fix a test that was only passing as a result of side-effects from other tests in the same TestCase.

The test was passing when run as part of the complete test case because a distribution of acme.foo with version 0.1a1 was already in the global working set. This PR changes the test to explicitly add acme.foo to the global working set, so that the test passes both standalone and as part of the whole test case.

(Note that the global working set is reset at tearDown time, though I plan another PR to clean up the test side-effects.)

Closes #441

mdickinson commented 3 years ago

test_ignore_broken_distributions_loads_good_distributions has a similar-looking issue. Converting to draft while I figure out whether I can fix that test too as part of this PR.

mdickinson commented 3 years ago

Second test fixed, and PR updated to use a cleaner fix for restoring sys.path.

rahulporuri commented 3 years ago

Never mind the approval. Didn't notice the CI failure.

mdickinson commented 3 years ago

Didn't notice the CI failure.

Sigh. Neither did I. Investigating.

mdickinson commented 3 years ago

Okay, looks like the problem is yet more dependence on global state. When I was testing, the acme.foo egg sitting inside the repository had been built, so it had an acme.foo.egg-info. After a git clean and a re-install, I can reproduce the failures locally.