如何定义时,如何让pytest尊重test_suite()?

时间:2017-02-16 08:24:48

标签: python pytest

我正在尝试使用pytest进行testfixtures传递测试,但是一些测试模块使用old pattern来定义一个名为test_suite的函数来返回测试:

def test_suite():
    return TestSuite((
        DocTestSuite(setUp=setUp, tearDown=tearDown),
        makeSuite(LogCaptureTests),
        ))

当pytest尝试收集它时,它会失败并抱怨:

WC1 /Users/chris/vcs/git/testfixtures/testfixtures/tests/test_logcapture.py cannot collect test class 'TestSuite' because it has a __init__ constructor

我怎样才能让它收集测试呢?

0 个答案:

没有答案