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

Skip to content

Commit 8fc25dc

Browse files
committed
Fix nose image comparison test on Python 2.
1 parent 6545022 commit 8fc25dc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/tests/test_compare_images.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from __future__ import (absolute_import, division, print_function,
22
unicode_literals)
33

4+
import six
5+
46
import io
57
import os
68
import shutil
@@ -206,7 +208,10 @@ def addFailure(self, test, err):
206208
suite = loader.loadTestsFromGenerator(
207209
func,
208210
'matplotlib.tests.test_compare_images')
209-
output = io.StringIO()
211+
if six.PY2:
212+
output = io.BytesIO()
213+
else:
214+
output = io.StringIO()
210215
result = TestResultVerifier(stream=output, descriptions=True, verbosity=1)
211216
with warnings.catch_warnings():
212217
# Nose uses deprecated stuff; we don't care about it.

0 commit comments

Comments
 (0)