change: generate reports folder in current working directory

This commit is contained in:
debugtalk
2020-03-10 17:24:19 +08:00
parent a0764ee5b3
commit 99df56512c
3 changed files with 2 additions and 3 deletions

View File

@@ -8,6 +8,7 @@
- remove support for Python 2.7
- replace string format with f-string
- remove dependency colorama and colorlog
- generate reports folder in current working directory
## 2.5.7 (2020-02-21)

View File

@@ -50,7 +50,6 @@ 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.
@@ -194,7 +193,6 @@ class HttpRunner(object):
"""
capture_message("start to run tests")
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")

View File

@@ -102,7 +102,7 @@ def main():
try:
for path in args.testfile_paths:
summary = runner.run(path, dot_env_path=args.dot_env_path)
report_dir = args.report_dir or os.path.join(runner.project_working_directory, "reports")
report_dir = args.report_dir or os.path.join(os.getcwd(), "reports")
gen_html_report(
summary,
report_template=args.report_template,