def __init__(self, testcases_to_run, nr_of_tests, all_should_pass=True,
print_bad=True, runner_options=None):
runner_options = runner_options or {}
self.nr_of_tests = nr_of_tests
self.all_should_pass = all_should_pass
self.print_bad = print_bad
django_runner_cls = get_runner(settings)
django_runner = django_runner_cls(**runner_options)
self.suite = django_runner.test_suite()
for testcase_cls in testcases_to_run:
tests = django_runner.test_loader.loadTestsFromTestCase(
testcase_cls)
self.suite.addTests(tests)
self.test_runner = django_runner.test_runner(
resultclass=django_runner.get_resultclass(),
stream=six.StringIO()
)
test_helpers.py 文件源码
python
阅读 28
收藏 0
点赞 0
评论 0
评论列表
文章目录