Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

run nosetests in all subdirectories

I can run tests in workflow folder with nosetests:

workflow maks$ nosetests
..........
----------------------------------------------------------------------
Ran 10 tests in 0.093s

OK

my tests live in test folder:

workflow maks$ ls
__pycache__     iterations.py       test
data            iterationsClass.py  testData
env         iterationsClass.pyc

But when I move to parent dir:

(py3env)Makss-Mac:workflow maks$ cd ..

It cannot find tests.

(py3env)Makss-Mac:Packages maks$ nosetests

----------------------------------------------------------------------
Ran 0 tests in 0.005s

OK

So how to make nosetest search tests in all subdirectories?

like image 320
Maxim Yefremov Avatar asked Nov 08 '13 05:11

Maxim Yefremov


1 Answers

If you make your workflow folder a module by placing __init__.py in it, nose should be able to find your tests.

like image 66
Oleksiy Avatar answered Sep 24 '22 13:09

Oleksiy