I have a project with the following directory structure:
.
βββ requirements.txt
βββ main.py
βββ tests
βββ unit
β βββ test_thing1.py
β βββ test_thing2.py
βββ integration.py
βββ test_integration_thing1.py
βββ test_integration_thing2.py
I want to run all tests with a single command . If I execute python -m unittest discover
, tests are not executed.
I found this question suggesting adding a file __init__.py
to create packages from folders unit
and integration
. The solution works, and all tests work this way.
But since I am using python3 and __init__.py
files are not required with an implicit namespace package , I was wondering if there is a way to do this without these __init__.py
files.
source
share