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

Issue #155 resolved
Ned Batchelder repo owner created an issue

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.

Comments (1)

  1. Log in to comment