diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index a58035c6..06b8d1c5 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,7 @@ **Fixed** - fix: avoid '.csv' been converted to '_csv' +- fix: convert har to JSON format testcase ## 3.0.12 (2020-06-14) diff --git a/httprunner/ext/har2case/__init__.py b/httprunner/ext/har2case/__init__.py index c1a074b4..4a503962 100644 --- a/httprunner/ext/har2case/__init__.py +++ b/httprunner/ext/har2case/__init__.py @@ -67,7 +67,7 @@ def main_har2case(args): if args.to_yaml: output_file_type = "YAML" - elif args.to_yaml: + elif args.to_json: output_file_type = "JSON" else: output_file_type = "pytest" diff --git a/httprunner/ext/har2case/core.py b/httprunner/ext/har2case/core.py index 3c491cf5..acb62951 100644 --- a/httprunner/ext/har2case/core.py +++ b/httprunner/ext/har2case/core.py @@ -338,8 +338,6 @@ class HarParser(object): capture_exception(ex) raise - logger.debug("prepared testcase: {}".format(testcase)) - if file_type == "JSON": output_testcase_file = f"{harfile}.json" utils.dump_json(testcase, output_testcase_file)