mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-13 06:29:44 +08:00
Merge pull request #539 from hluguoj/bugfix/report
fix: current validators will display the former one when they are empty.
This commit is contained in:
@@ -168,12 +168,12 @@ class SessionContext(object):
|
||||
def validate(self, validators, resp_obj):
|
||||
""" make validations
|
||||
"""
|
||||
self.validation_results = []
|
||||
if not validators:
|
||||
return
|
||||
|
||||
logger.log_debug("start to validate.")
|
||||
|
||||
self.validation_results = []
|
||||
validate_pass = True
|
||||
failures = []
|
||||
|
||||
|
||||
@@ -146,6 +146,9 @@ class TestContext(ApiServerUnittest):
|
||||
self.context.init_test_variables(variables)
|
||||
self.context.validate(validators, resp_obj)
|
||||
|
||||
self.context.validate([], resp_obj)
|
||||
self.assertEqual(self.context.validation_results, [])
|
||||
|
||||
def test_validate_exception(self):
|
||||
url = "http://127.0.0.1:5000/"
|
||||
resp = requests.get(url)
|
||||
|
||||
Reference in New Issue
Block a user