I have a test suite for my python app that I run with nose2.
I used to have all of the tests in a single file; however, that file was getting over 1500 lines long so I've broken it up into multiple separate files.
The suite used to look like this:
tests/
test_all.py
And I would run a single test with the following command from just outside the tests
directory:
nose2 tests.test_all.MyTestCase.test_something
Now my suite looks something like this:
tests/
base.py
test_inputs.py
test_outputs.py
test_reports.py
Testing base.py
(which simply sets up the test class and has no tests itself) works fine:
nose2 tests.base
But when I run the following command I get an AttributeError: 'module' object has no attribute 'test_output'
:
nose2 tests.test_output
Further up the traceback I see the following error: ImportError: No Module named 'base'
. How can I tell nose2
to use base.py
?