Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use "coverage run -m unittest discover" if tests are in a "test" directory #155

Closed
nedbat opened this issue Oct 31, 2011 · 1 comment
Labels
bug Something isn't working run

Comments

@nedbat
Copy link
Owner

nedbat commented Oct 31, 2011

Although "python -m unittest discover" will properly run tests in a "test" directory, "coverage run -m unittest discover" will not. This is because "coverage run -m" will put the unittest directory into the sys,path, and that directory has a "test" subdirectory. The tests are discovered in the product's test directory, but when the time comes to import them, the unittest "test" directory is examined for them instead, where they do not exist, and the import fails.


@nedbat
Copy link
Owner Author

nedbat commented Oct 31, 2011

An extra element in sys.path meant that "test.test_foo" modules weren't found because they were sought in unittest.test. Fixed in <<changeset 781082764b17 (bb)>>.

@nedbat nedbat closed this as completed Oct 31, 2011
@nedbat nedbat added major bug Something isn't working run labels Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working run
Projects
None yet
Development

No branches or pull requests

1 participant