fixture.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:GSM-scanner 作者: yosriayed 项目源码 文件源码
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*
        """)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号