12

I have a nose.cfg file which i'm porting to nose2. I can't see any way in the nose2 docs to ignore a file or directory.

In nose 1 this was done via these two flags:

ignore-files=settings_test*
exclude-dir=ignorethisdir

How can this be done in nose2?

craigds
  • 2,072
  • 14
  • 25

2 Answers2

4

The exclude-dir is available when you install nose-exclude. This plugin is currently only available for nose1: https://bitbucket.org/kgrandis/nose-exclude/overview

What is available is defining:

__test__ = False

in each TestCase or TestSuite inherited class.

They must be inherited from these classes for this to work. This is made available by the dundertest plugin which comes with nose2 and is enabled by default.

  • Sadly this doesn't work when nose2 is running under python 2 and you're trying to get it to skip a python 3 source file that it can't even parse to get that far... – Aaron D. Marasco May 14 '21 at 11:00
0

Apparently noting yet to ignore directories as of June 2019.

Another approach would be to specify the directories you are actually using by specifying --start-dir option multiple times or having it in nose2.cfg file.

See the documentation.

Denis Rouzaud
  • 2,412
  • 2
  • 26
  • 45