本文整理汇总了Python中nose.selector.Selector.wantFile方法的典型用法代码示例。如果您正苦于以下问题:Python Selector.wantFile方法的具体用法?Python Selector.wantFile怎么用?Python Selector.wantFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nose.selector.Selector
的用法示例。
在下文中一共展示了Selector.wantFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_ignore_files_default
# 需要导入模块: from nose.selector import Selector [as 别名]
# 或者: from nose.selector.Selector import wantFile [as 别名]
def test_ignore_files_default(self):
"""A default configuration should always skip some 'hidden' files."""
s = Selector(Config())
assert not s.wantFile('_test_underscore.py')
assert not s.wantFile('.test_hidden.py')
assert not s.wantFile('setup.py')
示例2: test_ignore_files_override
# 需要导入模块: from nose.selector import Selector [as 别名]
# 或者: from nose.selector.Selector import wantFile [as 别名]
def test_ignore_files_override(self):
"""Override the configuration to skip only specified files."""
c = Config()
c.ignoreFiles = [re.compile(r'^test_favourite_colour\.py$')]
s = Selector(c)
assert s.wantFile('_test_underscore.py')
assert s.wantFile('.test_hidden.py')
assert not s.wantFile('setup.py') # Actually excluded because of testMatch
assert not s.wantFile('test_favourite_colour.py')
示例3: test_want_file
# 需要导入模块: from nose.selector import Selector [as 别名]
# 或者: from nose.selector.Selector import wantFile [as 别名]
def test_want_file(self):
#logging.getLogger('nose.selector').setLevel(logging.DEBUG)
#logging.basicConfig()
c = Config()
c.where = [absdir(os.path.join(os.path.dirname(__file__), 'support'))]
base = c.where[0]
s = Selector(c)
assert not s.wantFile('setup.py')
assert not s.wantFile('/some/path/to/setup.py')
assert not s.wantFile('ez_setup.py')
assert not s.wantFile('.test.py')
assert not s.wantFile('_test.py')
assert not s.wantFile('setup_something.py')
assert s.wantFile('test.py')
assert s.wantFile('foo/test_foo.py')
assert s.wantFile('bar/baz/test.py')
assert not s.wantFile('foo.py')
assert not s.wantFile('test_data.txt')
assert not s.wantFile('data.text')
assert not s.wantFile('bar/baz/__init__.py')