Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8059fe9

Browse files
tacaswelltimhoffm
andauthored
TST: fix skip logic and make test symmetric
Co-authored-by: Tim Hoffmann <[email protected]>
1 parent 0e5f32b commit 8059fe9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/matplotlib/tests/test_usetex.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,21 @@ def test_minus_no_descent(fontsize):
8181
assert len({*heights.values()}) == 1
8282

8383

84-
@pytest.mark.skipif(_has_tex_package('xcolor.sty'),
84+
@pytest.mark.skipif(not _has_tex_package('xcolor.sty'),
8585
reason='xcolor is not available')
8686
def test_usetex_xcolor():
8787
mpl.rcParams['text.usetex'] = True
8888

8989
fig = plt.figure()
90-
t = fig.text(0.5, 0.5, "Some text 0123456789")
90+
text = fig.text(0.5, 0.5, "Some text 0123456789")
9191
fig.canvas.draw()
92-
pos = t.get_window_extent()
9392

9493
mpl.rcParams['text.latex.preamble'] = r'\usepackage[dvipsnames]{xcolor}'
9594
fig = plt.figure()
96-
t = fig.text(0.5, 0.5, "Some text 0123456789")
95+
text2 = fig.text(0.5, 0.5, "Some text 0123456789")
9796
fig.canvas.draw()
98-
np.testing.assert_array_equal(t.get_window_extent(), pos)
97+
np.testing.assert_array_equal(text2.get_window_extent(),
98+
text.get_window_extent())
9999

100100

101101
def test_textcomp_full():

0 commit comments

Comments
 (0)