Excluding directory, module in python nosetest

后端 未结 3 1163
走了就别回头了
走了就别回头了 2021-01-17 08:10

We use nose to discover tests and run them. All the tests are written in TestCase compatible way so any test runner can run the. Problem is we have some directo

3条回答
  •  广开言路
    2021-01-17 08:48

    There is a nose-exclude plugin specifically for the task:

    nose-exclude is a Nose plugin that allows you to easily specify directories to be excluded from testing.

    Among other features, it introduces a new command-line argument called exclude-dir:

    nosetests --processes=10 --verbosity 2 --exclude-dir=/path/to/scripts
    

    Instead of passing a command-line argument, you can also set NOSE_EXCLUDE_DIRS environment variable, or set exclude-dir configuration key in .noserc or nose.cfg files.

提交回复
热议问题