def test_setup_exception(self, testdir):
testdir.makepyfile("""
import pytest
@pytest.yield_fixture(scope="module")
def arg1():
pytest.fail("setup")
yield 1
def test_1(arg1):
pass
""")
result = testdir.runpytest("-s")
result.stdout.fnmatch_lines("""
*pytest.fail*setup*
*1 error*
""")
评论列表
文章目录