test_recorder.py 文件源码

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

项目:pytest-vts 作者: bhodorog 项目源码 文件源码
def test_catch_all_gevented_requests(vts_rec_on, movie_server):
    """Keep this test at the very end to avoid messing up with the rest of the
    tests, since it's monkey patching the network related operations.

    Maybe write a custom pytest order enforcer later."""
    def _job():
        return http_get(movie_server.url)

    from gevent.pool import Pool
    import gevent.monkey
    gevent.monkey.patch_socket(dns=True)

    pool = Pool()
    for x in range(10):
        pool.spawn(_job)
    pool.join()
    assert len(vts_rec_on.cassette) == 10
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号