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

Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Clarify a few tests.
  • Loading branch information
anntzer committed Jan 28, 2016
commit 288bcc12d945a7081bde7abdb67b8f83e3770255
10 changes: 6 additions & 4 deletions lib/matplotlib/tests/test_backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from matplotlib import patheffects
from matplotlib.testing.decorators import cleanup, knownfailureif

from nose.tools import assert_equal


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

assert values[0] == values[1]
assert values[1] == values[2].replace(b'\r\n', b'\n')
assert_equal(values[0], values[1])
assert_equal(values[1], values[2].replace(b'\r\n', b'\n'))
for buffer in buffers:
buffer.close()

Expand Down Expand Up @@ -112,13 +114,13 @@ def test_composite_image():
fig.savefig(ps, format="ps")
ps.seek(0)
buff = ps.read()
assert buff.count(six.b(' colorimage')) == 1
assert_equal(buff.count(six.b(' colorimage')), 1)
plt.rcParams['image.composite_image'] = False
with io.BytesIO() as ps:
fig.savefig(ps, format="ps")
ps.seek(0)
buff = ps.read()
assert buff.count(six.b(' colorimage')) == 2
assert_equal(buff.count(six.b(' colorimage')), 2)


@cleanup
Expand Down