Skip to content

Commit e6b6a97

Browse files
add debug log - jsonpath tolerance
Signed-off-by: saravanan palanisamy <saravanan30erd@gmail.com>
1 parent 262bff5 commit e6b6a97

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

chaoslib/hypothesis.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,12 @@ def _(tolerance: dict, value: Any, configuration: Configuration = None,
353353
else:
354354
logger.debug("jsonpath found '{}'".format(str(values)))
355355

356-
logger.debug(
357-
"jsonpath found '{}' but expected '{}'".format(
358-
str(values), str(tolerance["expect"])))
356+
if result is True:
357+
if "expect" in tolerance:
358+
logger.debug(
359+
"jsonpath found '{}' and expected one of '{}'".format(
360+
str(values), str(tolerance["expect"])))
361+
359362
return result
360363
elif tolerance_type == "range":
361364
target = tolerance.get("target")

0 commit comments

Comments
 (0)