I ran into the same issue when running python -m unittest discover. Here is a good checklist to verify your setup. Nose is more flexible with the allowed configurations, but not necessarily better.
-
Make sure all files/directories start with
test. Do not usetest-something.py, since that is not a valid Python module name. Usetest_something.py. -
If you are putting your tests in a sub-directory (e.g.
test/), make sure you create atest/__init__.pyfile so python will treat the directory as a package. -
All class test cases definitions must be extend
unittest.TestCase. For example,class DataFormatTests(unittest.TestCase) -
All test cases methods definitions must start with
test_def test_data_format(self):