Skip to content

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

@nedbat

Description

@nedbat

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.


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrun

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions