mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-09 09:49:33 +08:00
change: generate reports folder in current working directory
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
- remove support for Python 2.7
|
- remove support for Python 2.7
|
||||||
- replace string format with f-string
|
- replace string format with f-string
|
||||||
- remove dependency colorama and colorlog
|
- remove dependency colorama and colorlog
|
||||||
|
- generate reports folder in current working directory
|
||||||
|
|
||||||
## 2.5.7 (2020-02-21)
|
## 2.5.7 (2020-02-21)
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ class HttpRunner(object):
|
|||||||
self.test_loader = unittest.TestLoader()
|
self.test_loader = unittest.TestLoader()
|
||||||
self.save_tests = save_tests
|
self.save_tests = save_tests
|
||||||
self._summary = None
|
self._summary = None
|
||||||
self.project_working_directory = None
|
|
||||||
|
|
||||||
def _add_tests(self, testcases):
|
def _add_tests(self, testcases):
|
||||||
""" initialize testcase with Runner() and add to test suite.
|
""" initialize testcase with Runner() and add to test suite.
|
||||||
@@ -194,7 +193,6 @@ class HttpRunner(object):
|
|||||||
"""
|
"""
|
||||||
capture_message("start to run tests")
|
capture_message("start to run tests")
|
||||||
project_mapping = tests_mapping.get("project_mapping", {})
|
project_mapping = tests_mapping.get("project_mapping", {})
|
||||||
self.project_working_directory = project_mapping.get("PWD", os.getcwd())
|
|
||||||
|
|
||||||
if self.save_tests:
|
if self.save_tests:
|
||||||
utils.dump_logs(tests_mapping, project_mapping, "loaded")
|
utils.dump_logs(tests_mapping, project_mapping, "loaded")
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ def main():
|
|||||||
try:
|
try:
|
||||||
for path in args.testfile_paths:
|
for path in args.testfile_paths:
|
||||||
summary = runner.run(path, dot_env_path=args.dot_env_path)
|
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(
|
gen_html_report(
|
||||||
summary,
|
summary,
|
||||||
report_template=args.report_template,
|
report_template=args.report_template,
|
||||||
|
|||||||
Reference in New Issue
Block a user