|
4 | 4 |
|
5 | 5 | import io
|
6 | 6 | import re
|
| 7 | +import warnings |
7 | 8 |
|
8 | 9 | import numpy as np
|
9 | 10 | import pytest
|
|
17 | 18 | _determinism_check)
|
18 | 19 |
|
19 | 20 |
|
20 |
| -needs_ghostscript = pytest.mark.xfail( |
21 |
| - matplotlib.checkdep_ghostscript()[0] is None, |
22 |
| - reason="This test needs a ghostscript installation") |
23 |
| - |
24 |
| - |
25 |
| -needs_usetex = pytest.mark.xfail( |
26 |
| - not matplotlib.checkdep_usetex(True), |
27 |
| - reason="This test needs a TeX installation") |
| 21 | +with warnings.catch_warnings(): |
| 22 | + warnings.simplefilter('ignore') |
| 23 | + needs_ghostscript = pytest.mark.skipif( |
| 24 | + matplotlib.checkdep_ghostscript()[0] is None, |
| 25 | + reason="This test needs a ghostscript installation") |
| 26 | + needs_usetex = pytest.mark.skipif( |
| 27 | + not matplotlib.checkdep_usetex(True), |
| 28 | + reason="This test needs a TeX installation") |
28 | 29 |
|
29 | 30 |
|
30 | 31 | # This tests tends to hit a TeX cache lock on AppVeyor.
|
31 | 32 | @pytest.mark.flaky(reruns=3)
|
32 | 33 | @pytest.mark.parametrize('format, use_log, rcParams', [
|
33 | 34 | ('ps', False, {}),
|
34 |
| - needs_ghostscript(('ps', False, {'ps.usedistiller': 'ghostscript'})), |
35 |
| - needs_usetex(needs_ghostscript(('ps', False, {'text.latex.unicode': True, |
36 |
| - 'text.usetex': True}))), |
| 35 | + pytest.param('ps', False, {'ps.usedistiller': 'ghostscript'}, |
| 36 | + marks=needs_ghostscript), |
| 37 | + pytest.param('ps', False, {'text.latex.unicode': True, |
| 38 | + 'text.usetex': True}, |
| 39 | + marks=[needs_ghostscript, needs_usetex]), |
37 | 40 | ('eps', False, {}),
|
38 | 41 | ('eps', True, {'ps.useafm': True}),
|
39 |
| - needs_usetex(needs_ghostscript(('eps', False, {'text.latex.unicode': True, |
40 |
| - 'text.usetex': True}))), |
| 42 | + pytest.param('eps', False, {'text.latex.unicode': True, |
| 43 | + 'text.usetex': True}, |
| 44 | + marks=[needs_ghostscript, needs_usetex]), |
41 | 45 | ], ids=[
|
42 | 46 | 'ps',
|
43 | 47 | 'ps with distiller',
|
|
0 commit comments