Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dbac64f

Browse filesBrowse files
committed
Handle pytest's new ParameterSet for markers.
Using pytest.param(..., marks=pytest.mark.something) is a different type than if using pytest.mark.something(...), so we need to handle that case on skipping extensions.
1 parent 15ca02f commit dbac64f
Copy full SHA for dbac64f

File tree

Expand file treeCollapse file tree

1 file changed

+10
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-4
lines changed

‎lib/matplotlib/testing/decorators.py

Copy file name to clipboardExpand all lines: lib/matplotlib/testing/decorators.py
+10-4Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,18 @@ def _xfail_if_format_is_uncomparable(extension):
158158

159159
def _mark_xfail_if_format_is_uncomparable(extension):
160160
if isinstance(extension, str):
161-
will_fail = extension not in comparable_formats()
161+
name = extension
162+
elif isinstance(extension, tuple):
163+
# Extension might be a pytest ParameterSet instead of a plain string.
164+
# Unfortunately, this type is not exposed, so since it's a namedtuple,
165+
# check for a tuple instead.
166+
name = extension.values[0]
162167
else:
163168
# Extension might be a pytest marker instead of a plain string.
164-
will_fail = extension.args[0] not in comparable_formats()
165-
if will_fail:
166-
fail_msg = 'Cannot compare %s files on this system' % extension
169+
name = extension.args[0]
170+
171+
if name not in comparable_formats():
172+
fail_msg = 'Cannot compare %s files on this system' % (name, )
167173
import pytest
168174
return pytest.mark.xfail(extension, reason=fail_msg, strict=False,
169175
raises=ImageComparisonFailure)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.