bugfix #96 skip feature: display skip testcases number corretly

This commit is contained in:
httprunner
2018-02-08 12:55:23 +08:00
parent 1f81623a66
commit 5bbbdc1997
3 changed files with 46 additions and 10 deletions

View File

@@ -15,7 +15,11 @@ class ApiTestCase(unittest.TestCase):
def runTest(self):
""" run testcase and check result.
"""
self.assertTrue(self.test_runner._run_test(self.testcase_dict))
skip_current_test = self.testcase_dict.get("skip", False)
if skip_current_test:
self.skipTest("skip this test")
else:
self.assertTrue(self.test_runner._run_test(self.testcase_dict))
class ApiTestSuite(unittest.TestSuite):
""" create test suite with a testset, it may include one or several testcases.