Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 55f170c

Browse files
committed
Fixed knownfailureif('indeterminate') for pytest
1 parent ce9933b commit 55f170c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/matplotlib/testing/decorators.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ def knownfailureif(fail_condition, msg=None, known_exception_class=None):
5959
"""
6060
if is_called_from_pytest():
6161
import pytest
62-
strict = fail_condition and fail_condition != 'indeterminate'
62+
if fail_condition == 'indeterminate':
63+
fail_condition, strict = True, False
64+
else:
65+
fail_condition, strict = bool(fail_condition), True
6366
return pytest.mark.xfail(condition=fail_condition, reason=msg,
6467
raises=known_exception_class, strict=strict)
6568
else:

0 commit comments

Comments
 (0)