test_integrates_with_django_testrunner.py 文件源码

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

项目:django-performance-testing 作者: PaesslerAG 项目源码 文件源码
def test_collected_results_serialized_to_settings_based_filename(
        settings, tmpfilepath):

    class SomeTestCase(unittest.TestCase):
        def test_foo(self):
            assert 'test name' in ctx.data, ctx.data.keys()
            tests = ctx.data['test name']
            assert len(tests) == 1
            assert [str(self)] == tests

    settings.DJPT_DATAFILE_PATH = tmpfilepath
    with override_current_context() as ctx:
        run_testcases_with_django_runner(SomeTestCase, nr_of_tests=1)
    reader = Reader(settings.DJPT_DATAFILE_PATH)
    assert [] != reader.read_all()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号