Skip to content

Commit 2efbdd6

Browse files
authored
Merge pull request #12339 from meeseeksmachine/auto-backport-of-pr-12297-on-v3.0.x
Backport PR #12297 on branch v3.0.x (Remove some pytest parameterising warnings)
2 parents 3c5ef6b + 6a92503 commit 2efbdd6

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

lib/matplotlib/tests/test_animation.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ def test_embed_limit(method_name, caplog, tmpdir):
229229
@pytest.mark.parametrize(
230230
"method_name",
231231
["to_html5_video",
232-
pytest.mark.xfail("to_jshtml")]) # Needs to be fixed.
232+
pytest.param("to_jshtml",
233+
marks=pytest.mark.xfail)])
233234
def test_cleanup_temporaries(method_name, tmpdir):
234235
with tmpdir.as_cwd():
235236
getattr(make_animation(frames=1), method_name)()

lib/matplotlib/tests/test_backend_ps.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
@pytest.mark.flaky(reruns=3)
2828
@pytest.mark.parametrize('format, use_log, rcParams', [
2929
('ps', False, {}),
30-
needs_ghostscript(
31-
('ps', False, {'ps.usedistiller': 'ghostscript'})),
32-
needs_usetex(needs_ghostscript(
33-
('ps', False, {'text.usetex': True}))),
30+
pytest.param('ps', False, {'ps.usedistiller': 'ghostscript'},
31+
marks=needs_ghostscript),
32+
pytest.param('ps', False, {'text.usetex': True},
33+
marks=[needs_ghostscript, needs_usetex]),
3434
('eps', False, {}),
3535
('eps', True, {'ps.useafm': True}),
36-
needs_usetex(needs_ghostscript(
37-
('eps', False, {'text.usetex': True}))),
36+
pytest.param('eps', False, {'text.usetex': True},
37+
marks=[needs_ghostscript, needs_usetex]),
3838
], ids=[
3939
'ps',
4040
'ps with distiller',

lib/matplotlib/tests/test_backend_svg.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _test_determinism_save(filename, usetex):
126126
"filename, usetex",
127127
# unique filenames to allow for parallel testing
128128
[("determinism_notex.svg", False),
129-
needs_usetex(("determinism_tex.svg", True))])
129+
pytest.param("determinism_tex.svg", True, marks=needs_usetex)])
130130
def test_determinism(filename, usetex):
131131
import sys
132132
from subprocess import check_output, STDOUT, CalledProcessError

lib/matplotlib/tests/test_backends_interactive.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ def _get_testable_interactive_backends():
3232
reason = "No $DISPLAY"
3333
elif any(importlib.util.find_spec(dep) is None for dep in deps):
3434
reason = "Missing dependency"
35-
backends.append(pytest.mark.skip(reason=reason)(backend) if reason
36-
else backend)
35+
if reason:
36+
backend = pytest.param(
37+
backend, marks=pytest.mark.skip(reason=reason))
38+
backends.append(backend)
3739
return backends
3840

3941

0 commit comments

Comments
 (0)