本文整理匯總了Python中nose.selector.Selector.wantModule方法的典型用法代碼示例。如果您正苦於以下問題:Python Selector.wantModule方法的具體用法?Python Selector.wantModule怎麽用?Python Selector.wantModule使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類nose.selector.Selector
的用法示例。
在下文中一共展示了Selector.wantModule方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_want_module
# 需要導入模塊: from nose.selector import Selector [as 別名]
# 或者: from nose.selector.Selector import wantModule [as 別名]
def test_want_module(self):
m = mod('whatever')
m2 = mod('this.that')
m3 = mod('this.that.another')
m4 = mod('this.that.another.one')
m5 = mod('test.something')
m6 = mod('a.test')
m7 = mod('my_tests')
m8 = mod('__main__')
s = Selector(Config())
assert not s.wantModule(m)
assert not s.wantModule(m2)
assert not s.wantModule(m3)
assert not s.wantModule(m4)
assert not s.wantModule(m5)
assert s.wantModule(m6)
assert s.wantModule(m7)
assert s.wantModule(m8)
m6.__test__ = False
assert not s.wantModule(m6), "Failed to respect __test__ = False"
示例2: test_want_module
# 需要導入模塊: from nose.selector import Selector [as 別名]
# 或者: from nose.selector.Selector import wantModule [as 別名]
def test_want_module(self):
m = mod("whatever")
m2 = mod("this.that")
m3 = mod("this.that.another")
m4 = mod("this.that.another.one")
m5 = mod("test.something")
m6 = mod("a.test")
m7 = mod("my_tests")
m8 = mod("__main__")
s = Selector(Config())
assert not s.wantModule(m)
assert not s.wantModule(m2)
assert not s.wantModule(m3)
assert not s.wantModule(m4)
assert not s.wantModule(m5)
assert s.wantModule(m6)
assert s.wantModule(m7)
assert s.wantModule(m8)
m6.__test__ = False
assert not s.wantModule(m6), "Failed to respect __test__ = False"