Search code examples
pythonnosetests

Add more test patterns to nosetests in python?


So I have a directory named "test" inside which I have a few more directories, which have a lot of tests. How do I add such patterns so that nosetests determines these tests and runs it?


Solution

  • You can run nosetests with option -i --include:

    -i REGEX, --include=REGEX
                          This regular expression will be applied to files,
                          directories, function names, and class names for a
                          chance to include additional tests that do not match
                          TESTMATCH.  Specify this option multiple times to add
                          more regular expressions [NOSE_INCLUDE]