change: --report-file, specify report file path, this has higher priority than specifying report dir.

This commit is contained in:
debugtalk
2019-11-01 19:34:26 +08:00
parent 0d0ecb241f
commit accc06733c
5 changed files with 25 additions and 9 deletions

View File

@@ -1,3 +1,4 @@
import os
import unittest
from httprunner import (__version__, exceptions, loader, logger, parser,
@@ -27,6 +28,7 @@ class HttpRunner(object):
self.test_loader = unittest.TestLoader()
self.save_tests = save_tests
self._summary = None
self.project_working_directory = None
def _add_tests(self, testcases):
""" initialize testcase with Runner() and add to test suite.
@@ -166,6 +168,8 @@ class HttpRunner(object):
""" run testcase/testsuite data
"""
project_mapping = tests_mapping.get("project_mapping", {})
self.project_working_directory = project_mapping.get("PWD", os.getcwd())
if self.save_tests:
utils.dump_logs(tests_mapping, project_mapping, "loaded")