conftest.py 文件源码

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

项目:detox 作者: tox-dev 项目源码 文件源码
def test_hang(testdir):
    p = py.path.local(__file__).dirpath('conftest.py')
    p.copy(testdir.tmpdir.join(p.basename))
    t = testdir.makepyfile("""
        import pytest
        from eventlet.green import time
        @pytest.mark.timeout(0.01)
        def test_hang():
            time.sleep(3.0)
    """)
    result = testdir.runpytest()
    assert "failed to timeout" not in result.stdout.str()
    result.stdout.fnmatch_lines(["*Timeout: 0.01*"])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号