bugfix: when variable reference in testcase name is extracted from former testcase, exception will occur

This commit is contained in:
httprunner
2018-04-02 16:28:46 +08:00
parent 54bf5af7a8
commit a64ecddb3c
2 changed files with 6 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
__title__ = 'HttpRunner' __title__ = 'HttpRunner'
__description__ = 'One-stop solution for HTTP(S) testing.' __description__ = 'One-stop solution for HTTP(S) testing.'
__url__ = 'https://github.com/HttpRunner/HttpRunner' __url__ = 'https://github.com/HttpRunner/HttpRunner'
__version__ = '1.3.7' __version__ = '1.3.8.beta'
__author__ = 'debugtalk' __author__ = 'debugtalk'
__author_email__ = 'mail@debugtalk.com' __author_email__ = 'mail@debugtalk.com'
__license__ = 'MIT' __license__ = 'MIT'

View File

@@ -97,7 +97,11 @@ class TestSuite(unittest.TestSuite):
testcase_variables testcase_variables
) )
self.testcase_parser.update_binded_variables(variables) self.testcase_parser.update_binded_variables(variables)
testcase_name = self.testcase_parser.eval_content_with_bindings(testcase_dict["name"]) try:
testcase_name = self.testcase_parser.eval_content_with_bindings(testcase_dict["name"])
except (AssertionError, exception.ParamsError):
logger.log_warning("failed to eval testcase name: {}".format(testcase_dict["name"]))
testcase_name = testcase_dict["name"]
self.test_runner_list.append((test_runner, variables)) self.test_runner_list.append((test_runner, variables))
self._add_test_to_suite(testcase_name, test_runner, testcase_dict) self._add_test_to_suite(testcase_name, test_runner, testcase_dict)