test_worst_report_integrates_with_django_testrunner.py 文件源码

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

项目:django-performance-testing 作者: PaesslerAG 项目源码 文件源码
def packaged_runner(db):
    class SampleTestCase(unittest.TestCase):

        def test_whatever_one(self):
            results_collected.send(
                sender=WithId('whatever'), results=[1],
                context={'test': 'one'})

        def test_whatever_two(self):
            results_collected.send(
                sender=WithId('whatever'), results=[2],
                context={'test': 'two'})

        def test_slow_query(self):
            list(Group.objects.all())

    def get_packaged_runner_with_options(options=None):
        options = options or {}
        return run_testcases_with_django_runner(SampleTestCase, nr_of_tests=3,
                                                runner_options=options)
    return get_packaged_runner_with_options
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号