Skip to content

Commit 288bcc1

Browse files
committed
Clarify a few tests.
1 parent 277574f commit 288bcc1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/matplotlib/tests/test_backend_ps.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from matplotlib import patheffects
1414
from matplotlib.testing.decorators import cleanup, knownfailureif
1515

16+
from nose.tools import assert_equal
17+
1618

1719
needs_ghostscript = knownfailureif(
1820
matplotlib.checkdep_ghostscript()[0] is None,
@@ -51,8 +53,8 @@ def _test_savefig_to_stringio(format='ps', use_log=False):
5153
# could change from run to run, such as the time.
5254
values = [re.sub(b'%%.*?\n', b'', x) for x in values]
5355

54-
assert values[0] == values[1]
55-
assert values[1] == values[2].replace(b'\r\n', b'\n')
56+
assert_equal(values[0], values[1])
57+
assert_equal(values[1], values[2].replace(b'\r\n', b'\n'))
5658
for buffer in buffers:
5759
buffer.close()
5860

@@ -112,13 +114,13 @@ def test_composite_image():
112114
fig.savefig(ps, format="ps")
113115
ps.seek(0)
114116
buff = ps.read()
115-
assert buff.count(six.b(' colorimage')) == 1
117+
assert_equal(buff.count(six.b(' colorimage')), 1)
116118
plt.rcParams['image.composite_image'] = False
117119
with io.BytesIO() as ps:
118120
fig.savefig(ps, format="ps")
119121
ps.seek(0)
120122
buff = ps.read()
121-
assert buff.count(six.b(' colorimage')) == 2
123+
assert_equal(buff.count(six.b(' colorimage')), 2)
122124

123125

124126
@cleanup

0 commit comments

Comments
 (0)