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

Skip to content

Commit 05b88ad

Browse files
committed
Fix check for pytest-marked extensions.
All because of the mixed subplots test which marks one extension as xfail. This was technically not checked correctly, but ended up with the same result of the 'svg' extension being treated as xfail.
1 parent 96dcb33 commit 05b88ad

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/testing/decorators.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,11 @@ def _xfail_if_format_is_uncomparable(extension):
223223

224224

225225
def _mark_xfail_if_format_is_uncomparable(extension):
226-
will_fail = extension not in comparable_formats()
226+
if isinstance(extension, six.string_types):
227+
will_fail = extension not in comparable_formats()
228+
else:
229+
# Extension might be a pytest marker instead of a plain string.
230+
will_fail = extension.args[0] not in comparable_formats()
227231
if will_fail:
228232
fail_msg = 'Cannot compare %s files on this system' % extension
229233
import pytest

0 commit comments

Comments
 (0)