如何忽略nose2中的文件或目录?

cra*_*gds 10 python nose2

我有一个nose.cfg文件,我正在移植到nose2.我无法在nose2文档中看到任何忽略文件或目录的方法.

在鼻子1中,这是通过这两个标志完成的:

ignore-files=settings_test*
exclude-dir=ignorethisdir
Run Code Online (Sandbox Code Playgroud)

怎么能在nose2中完成?

小智 4

当您安装鼻子排除时,排除目录可用。该插件目前仅适用于nose1:https ://bitbucket.org/kgrandis/nose-exclude/overview

可用的是定义:

__test__ = False

在每个 TestCase 或 TestSuite 继承类中。

它们必须从这些类继承才能发挥作用。这是通过鼻子2附带的dundertest插件提供的,并且默认启用。