refactor run times: display test statistics correctly with run times setting

This commit is contained in:
httprunner
2018-02-08 12:18:02 +08:00
parent fc88377c4a
commit 1f81623a66
5 changed files with 116 additions and 31 deletions

24
tests/test_cli.py Normal file
View File

@@ -0,0 +1,24 @@
import os
import shutil
import sys
from httprunner.task import TaskSuite
from pyunitreport import HTMLTestRunner
from tests.base import ApiServerUnittest
class TestCli(ApiServerUnittest):
def test_run_times(self):
testset_path = "tests/data/demo_testset_cli.yml"
output_folder_name = os.path.basename(os.path.splitext(testset_path)[0])
kwargs = {
"output": output_folder_name
}
task_suite = TaskSuite(testset_path)
result = HTMLTestRunner(**kwargs).run(task_suite)
self.assertEqual(result.testsRun, 5)
report_save_dir = os.path.join(os.getcwd(), 'reports', output_folder_name)
shutil.rmtree(report_save_dir)