python - Running unit and integration tests (residing in different directories) separately using nose -


i wondering while now, not able figure out how pass options nosetests run different tests reside in different sub-directories. example of package directory structure:

my_package/ |-- my_module1/    |-- tests/        |-- unit/            | ... bunch of unit tests        |-- integration/            |... bunch of integration tests |-- my_module2/    |-- tests/        |-- unit/            | ... bunch of unit tests        |-- integration/            |... bunch of integration tests 

if want execute unit tests in modules (all tests in tests/unit/ sub-directories), how using nosetests library?

i think --where or --match nosetests arguments can you:

-w where, --where=where tests in directory. may specified multiple times. first directory passed used working directory, in place of current working directory, default. others added list of tests execute. [nose_where]

-m regex, --match=regex, --testmatch=regex files, directories, function names, , class names match regular expression considered tests. default: (?:^|[\b_./-])[tt]est [nose_testmatch]

also, see anyone know how nosetest's -m, -i , -e work?

but, actually, prefer have tests dir @ root level: how organize , run unittests , functional tests separately using nosetests


Comments