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:
debugtalk
2018-02-07 11:08:47 +08:00
parent c8507f8f60
commit 8b039d3b1e
2 changed files with 8 additions and 2 deletions

View File

@@ -1 +1 @@
__version__ = '0.8.8'
__version__ = '0.8.9'

View File

@@ -71,6 +71,7 @@ class Runner(object):
@param (dict) testcase_dict
{
"name": "testcase description",
"skip": Fasle,
"times": 3,
"requires": [], # optional, override
"function_binds": {}, # optional, override
@@ -101,7 +102,12 @@ class Runner(object):
except KeyError:
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", [])
validators = testcase_dict.get("validate", [])
setup_actions = testcase_dict.get("setup", [])