From 7b6922817c23aadfd97ff7b8f9ae1540841d77db Mon Sep 17 00:00:00 2001 From: debugtalk Date: Wed, 16 Jan 2019 17:47:44 +0800 Subject: [PATCH] bugfix: make compatible with testcase name is empty --- httprunner/__about__.py | 2 +- httprunner/parser.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/httprunner/__about__.py b/httprunner/__about__.py index 8cfb52d4..774f7c60 100644 --- a/httprunner/__about__.py +++ b/httprunner/__about__.py @@ -1,7 +1,7 @@ __title__ = 'HttpRunner' __description__ = 'One-stop solution for HTTP(S) testing.' __url__ = 'https://github.com/HttpRunner/HttpRunner' -__version__ = '2.0.0' +__version__ = '2.0.1' __author__ = 'debugtalk' __author_email__ = 'mail@debugtalk.com' __license__ = 'Apache-2.0' diff --git a/httprunner/parser.py b/httprunner/parser.py index 27c80ee7..f4b82ff8 100644 --- a/httprunner/parser.py +++ b/httprunner/parser.py @@ -733,8 +733,12 @@ def _extend_with_testcase(test_dict, testcase_def_dict): test_verify = test_dict.pop("verify", True) testcase_def_dict["config"].setdefault("verify", test_verify) + # override name + test_name = test_dict.pop("name") or testcase_def_dict["config"].pop("name") or "Undefined name" + # override testcase config name, output, etc. testcase_def_dict["config"].update(test_dict) + testcase_def_dict["config"]["name"] = test_name test_dict.clear() test_dict.update(testcase_def_dict)