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 46d3860

Browse filesBrowse files
committed
TST: Use new method for applying pytest markers.
1 parent dbac64f commit 46d3860
Copy full SHA for 46d3860

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

+10
-5
lines changed

‎lib/matplotlib/testing/decorators.py

Copy file name to clipboardExpand all lines: lib/matplotlib/testing/decorators.py
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,20 +159,24 @@ def _xfail_if_format_is_uncomparable(extension):
159159
def _mark_xfail_if_format_is_uncomparable(extension):
160160
if isinstance(extension, str):
161161
name = extension
162+
marks = []
162163
elif isinstance(extension, tuple):
163164
# Extension might be a pytest ParameterSet instead of a plain string.
164165
# Unfortunately, this type is not exposed, so since it's a namedtuple,
165166
# check for a tuple instead.
166167
name = extension.values[0]
168+
marks = list(extension.marks)
167169
else:
168170
# Extension might be a pytest marker instead of a plain string.
169171
name = extension.args[0]
172+
marks = [extension.mark]
170173

171174
if name not in comparable_formats():
172175
fail_msg = 'Cannot compare %s files on this system' % (name, )
173176
import pytest
174-
return pytest.mark.xfail(extension, reason=fail_msg, strict=False,
175-
raises=ImageComparisonFailure)
177+
marks += [pytest.mark.xfail(reason=fail_msg, strict=False,
178+
raises=ImageComparisonFailure)]
179+
return pytest.param(name, marks=marks)
176180
else:
177181
return extension
178182

‎lib/mpl_toolkits/tests/test_mplot3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/tests/test_mplot3d.py
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,10 @@ def test_lines3d():
133133

134134

135135
# Reason for flakiness of SVG test is still unknown.
136-
@image_comparison(baseline_images=['mixedsubplot'], remove_text=True,
137-
extensions=['png', 'pdf',
138-
pytest.mark.xfail('svg', strict=False)])
136+
@image_comparison(
137+
baseline_images=['mixedsubplot'], remove_text=True,
138+
extensions=['png', 'pdf',
139+
pytest.param('svg', marks=pytest.mark.xfail(strict=False))])
139140
def test_mixedsubplots():
140141
def f(t):
141142
s1 = np.cos(2*np.pi*t)

0 commit comments

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