Can't use "coverage run -m unittest discover" if tests are in a "test" directory · Issue #155 · nedbat/coveragepy (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
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.