我有跟随通过py.test运行的unittest代码.仅运行构造函数会在运行py.test -v -s时跳过整个类
收集0件/ 1跳过
任何人都可以向我解释py.test的这种行为吗?
我有兴趣了解py.test行为,我知道不需要构造函数.
谢谢,Zdenek
class TestClassName(object):
def __init__(self):
pass
def setup_method(self, method):
print "setup_method called"
def teardown_method(self, method):
print "teardown_method called"
def test_a(self):
print "test_a called"
assert 1 == 1
def test_b(self):
print "test_b called"
assert 1 == 1
Run Code Online (Sandbox Code Playgroud)