|
27 | 27 | reason="This test needs a TeX installation")
|
28 | 28 |
|
29 | 29 |
|
30 |
| -def _test_savefig_to_stringio(format='ps', use_log=False): |
| 30 | +@pytest.mark.parametrize('format, use_log, rcParams', [ |
| 31 | + ('ps', False, {}), |
| 32 | + needs_ghostscript(('ps', False, {'ps.usedistiller': 'ghostscript'})), |
| 33 | + needs_tex(needs_ghostscript(('ps', False, {'text.latex.unicode': True, |
| 34 | + 'text.usetex': True}))), |
| 35 | + ('eps', False, {}), |
| 36 | + ('eps', True, {'ps.useafm': True}), |
| 37 | + needs_tex(needs_ghostscript(('eps', False, {'text.latex.unicode': True, |
| 38 | + 'text.usetex': True}))), |
| 39 | +], ids=[ |
| 40 | + 'ps', |
| 41 | + 'ps with distiller', |
| 42 | + 'ps with usetex', |
| 43 | + 'eps', |
| 44 | + 'eps afm', |
| 45 | + 'eps with usetex' |
| 46 | +]) |
| 47 | +def test_savefig_to_stringio(format, use_log, rcParams): |
| 48 | + matplotlib.rcParams.update(rcParams) |
| 49 | + |
31 | 50 | fig, ax = plt.subplots()
|
32 | 51 | buffers = [
|
33 | 52 | six.moves.StringIO(),
|
@@ -60,41 +79,6 @@ def _test_savefig_to_stringio(format='ps', use_log=False):
|
60 | 79 | buffer.close()
|
61 | 80 |
|
62 | 81 |
|
63 |
| -def test_savefig_to_stringio(): |
64 |
| - _test_savefig_to_stringio() |
65 |
| - |
66 |
| - |
67 |
| -@needs_ghostscript |
68 |
| -def test_savefig_to_stringio_with_distiller(): |
69 |
| - matplotlib.rcParams['ps.usedistiller'] = 'ghostscript' |
70 |
| - _test_savefig_to_stringio() |
71 |
| - |
72 |
| - |
73 |
| -@needs_tex |
74 |
| -@needs_ghostscript |
75 |
| -def test_savefig_to_stringio_with_usetex(): |
76 |
| - matplotlib.rcParams['text.latex.unicode'] = True |
77 |
| - matplotlib.rcParams['text.usetex'] = True |
78 |
| - _test_savefig_to_stringio() |
79 |
| - |
80 |
| - |
81 |
| -def test_savefig_to_stringio_eps(): |
82 |
| - _test_savefig_to_stringio(format='eps') |
83 |
| - |
84 |
| - |
85 |
| -def test_savefig_to_stringio_eps_afm(): |
86 |
| - matplotlib.rcParams['ps.useafm'] = True |
87 |
| - _test_savefig_to_stringio(format='eps', use_log=True) |
88 |
| - |
89 |
| - |
90 |
| -@needs_tex |
91 |
| -@needs_ghostscript |
92 |
| -def test_savefig_to_stringio_with_usetex_eps(): |
93 |
| - matplotlib.rcParams['text.latex.unicode'] = True |
94 |
| - matplotlib.rcParams['text.usetex'] = True |
95 |
| - _test_savefig_to_stringio(format='eps') |
96 |
| - |
97 |
| - |
98 | 82 | def test_composite_image():
|
99 | 83 | # Test that figures can be saved with and without combining multiple images
|
100 | 84 | # (on a single set of axes) into a single composite image.
|
|
0 commit comments