mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-14 04:09:38 +08:00
#96: refactor skip feature:
1, with skip keyword, skip current test unconditionally; 2, with skipIf keyword, you can skip current test with condition; condition evaluation can be defined in debugtalk.py function.
This commit is contained in:
@@ -15,9 +15,9 @@ class ApiTestCase(unittest.TestCase):
|
||||
def runTest(self):
|
||||
""" run testcase and check result.
|
||||
"""
|
||||
skip_current_test = self.testcase_dict.get("skip", False)
|
||||
if skip_current_test:
|
||||
self.skipTest("skip this test")
|
||||
if "skip" in self.testcase_dict:
|
||||
skip_reason = self.testcase_dict["skip"]
|
||||
self.skipTest(skip_reason)
|
||||
else:
|
||||
self.assertTrue(self.test_runner._run_test(self.testcase_dict))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user