fix #96: add skip feature

1, skip=True is equal to times=0;
2, skip priority is higher than times.
This commit is contained in:
httprunner
2018-02-07 11:26:28 +08:00
parent 5048a0785d
commit fc88377c4a
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
__version__ = '0.8.8' __version__ = '0.8.9'
+7 -1
View File
@@ -71,6 +71,7 @@ class Runner(object):
@param (dict) testcase_dict @param (dict) testcase_dict
{ {
"name": "testcase description", "name": "testcase description",
"skip": Fasle,
"times": 3, "times": 3,
"requires": [], # optional, override "requires": [], # optional, override
"function_binds": {}, # optional, override "function_binds": {}, # optional, override
@@ -101,7 +102,12 @@ class Runner(object):
except KeyError: except KeyError:
raise exception.ParamsError("URL or METHOD missed!") raise exception.ParamsError("URL or METHOD missed!")
run_times = int(testcase_dict.get("times", 1)) skip_current_test = testcase_dict.get("skip", False)
if skip_current_test:
run_times = 0
else:
run_times = int(testcase_dict.get("times", 1))
extractors = testcase_dict.get("extract", []) extractors = testcase_dict.get("extract", [])
validators = testcase_dict.get("validate", []) validators = testcase_dict.get("validate", [])
setup_actions = testcase_dict.get("setup", []) setup_actions = testcase_dict.get("setup", [])