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

Skip to content

Commit 80f89a1

Browse files
committed
test_compare_images: Fix errors on Python 2.6 because assert_is_none is not available.
1 parent 23b03aa commit 80f89a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/tests/test_compare_images.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import print_function
22
from matplotlib.testing.compare import compare_images
33
from matplotlib.testing.decorators import _image_directories
4-
import nose.tools
4+
from nose.tools import assert_equal, assert_not_equal, assert_almost_equal
55
import os
66
import shutil
77

@@ -29,10 +29,10 @@ def image_comparison_expect_rms(im1, im2, tol, expect_rms):
2929
results = compare_images(im1, im2, tol=tol, in_decorator=True)
3030

3131
if expect_rms is None:
32-
nose.tools.assert_is_none(results)
32+
assert_equal(None, results)
3333
else:
34-
nose.tools.assert_is_not_none(results)
35-
nose.tools.assert_almost_equal(expect_rms, results['rms'], places=4)
34+
assert_not_equal(None, results)
35+
assert_almost_equal(expect_rms, results['rms'], places=4)
3636

3737
def test_image_compare_basic():
3838
"""Test comparison of an image and the same image with minor differences."""

0 commit comments

Comments
 (0)