Search code examples
pythonpython-2.7testingnosenosetests

How can I ignore all tests in a specific folder using nose?


I have many unit tests organized in the following manner:

test_dir/
  test_important1.py
  test_important2.py
  test_important3.py
  ....
  basic tests/testA1.py
              testA2.py
              ....
              __init__.py

I want to run all test in the test_dir directory itself, not including tests found at basic tests.

How can this be achieved?

Thanks!


Solution

  • There is an --exclude-dir option introduced by nose-exclude:

    nosetests --exclude-dir="basic tests/"