本文整理匯總了Python中nose.selector.Selector.wantClass方法的典型用法代碼示例。如果您正苦於以下問題:Python Selector.wantClass方法的具體用法?Python Selector.wantClass怎麽用?Python Selector.wantClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類nose.selector.Selector
的用法示例。
在下文中一共展示了Selector.wantClass方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_want_class
# 需要導入模塊: from nose.selector import Selector [as 別名]
# 或者: from nose.selector.Selector import wantClass [as 別名]
def test_want_class(self):
class Foo:
pass
class Bar(unittest.TestCase):
pass
class TestMe:
pass
class TestType(type):
def __new__(cls, name, bases, dct):
return type.__new__(cls, name, bases, dct)
class TestClass(object, metaclass=TestType):
pass
s = Selector(Config())
assert not s.wantClass(Foo)
assert s.wantClass(Bar)
assert s.wantClass(TestMe)
assert s.wantClass(TestClass)
TestMe.__test__ = False
assert not s.wantClass(TestMe), "Failed to respect __test__ = False"
Bar.__test__ = False
assert not s.wantClass(Bar), "Failed to respect __test__ = False"