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