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 f4b430f

Browse filesBrowse files
QuLogicArchangeGabriel
authored andcommitted
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 7c4f28c commit f4b430f
Copy full SHA for f4b430f

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
@@ -223,12 +223,18 @@ def _xfail_if_format_is_uncomparable(extension):
223223

224224
def _mark_xfail_if_format_is_uncomparable(extension):
225225
if isinstance(extension, six.string_types):
226-
will_fail = extension not in comparable_formats()
226+
name = extension
227+
elif isinstance(extension, tuple):
228+
# Extension might be a pytest ParameterSet instead of a plain string.
229+
# Unfortunately, this type is not exposed, so since it's a namedtuple,
230+
# check for a tuple instead.
231+
name = extension.values[0]
227232
else:
228233
# Extension might be a pytest marker instead of a plain string.
229-
will_fail = extension.args[0] not in comparable_formats()
230-
if will_fail:
231-
fail_msg = 'Cannot compare %s files on this system' % extension
234+
name = extension.args[0]
235+
236+
if name not in comparable_formats():
237+
fail_msg = 'Cannot compare %s files on this system' % (name, )
232238
import pytest
233239
return pytest.mark.xfail(extension, reason=fail_msg, strict=False,
234240
raises=ImageComparisonFailure)

0 commit comments

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