mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-04 23:16:57 +08:00
evaluate testcase name
This commit is contained in:
@@ -168,6 +168,11 @@ class Runner(object):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def get_eval_content(self, content):
|
||||||
|
""" evaluate content with variable bindings
|
||||||
|
"""
|
||||||
|
return self.context.testcase_parser.parse_content_with_bindings(content)
|
||||||
|
|
||||||
def extract_output(self, output_variables_list):
|
def extract_output(self, output_variables_list):
|
||||||
""" extract output variables
|
""" extract output variables
|
||||||
"""
|
"""
|
||||||
|
|||||||
+3
-2
@@ -72,10 +72,11 @@ class ApiTestSuite(unittest.TestSuite):
|
|||||||
|
|
||||||
def _add_tests_to_suite(self, testcases):
|
def _add_tests_to_suite(self, testcases):
|
||||||
for testcase_dict in testcases:
|
for testcase_dict in testcases:
|
||||||
|
testcase_name = self.test_runner.get_eval_content(testcase_dict["name"])
|
||||||
if utils.PYTHON_VERSION == 3:
|
if utils.PYTHON_VERSION == 3:
|
||||||
ApiTestCase.runTest.__doc__ = testcase_dict['name']
|
ApiTestCase.runTest.__doc__ = testcase_name
|
||||||
else:
|
else:
|
||||||
ApiTestCase.runTest.__func__.__doc__ = testcase_dict['name']
|
ApiTestCase.runTest.__func__.__doc__ = testcase_name
|
||||||
|
|
||||||
test = ApiTestCase(self.test_runner, testcase_dict)
|
test = ApiTestCase(self.test_runner, testcase_dict)
|
||||||
[self.addTest(test) for _ in range(int(testcase_dict.get("times", 1)))]
|
[self.addTest(test) for _ in range(int(testcase_dict.get("times", 1)))]
|
||||||
|
|||||||
Reference in New Issue
Block a user