1
1
from __future__ import print_function
2
2
from matplotlib .testing .compare import compare_images
3
3
from matplotlib .testing .decorators import _image_directories
4
+ import nose .tools
4
5
import os
5
6
import shutil
6
7
@@ -18,8 +19,6 @@ def image_comparison_expect_rms(im1, im2, tol, expect_rms):
18
19
succeed if compare_images succeeds. Otherwise, the test will succeed if
19
20
compare_images fails and returns an RMS error almost equal to this value.
20
21
"""
21
- from nose .tools import assert_almost_equal
22
- from nose .tools import assert_is_none , assert_is_not_none
23
22
im1 = os .path .join (baseline_dir , im1 )
24
23
im2_src = os .path .join (baseline_dir , im2 )
25
24
im2 = os .path .join (result_dir , im2 )
@@ -30,10 +29,10 @@ def image_comparison_expect_rms(im1, im2, tol, expect_rms):
30
29
results = compare_images (im1 , im2 , tol = tol , in_decorator = True )
31
30
32
31
if expect_rms is None :
33
- assert_is_none (results )
32
+ nose . tools . assert_is_none (results )
34
33
else :
35
- assert_is_not_none (results )
36
- assert_almost_equal (expect_rms , results ['rms' ], places = 4 )
34
+ nose . tools . assert_is_not_none (results )
35
+ nose . tools . assert_almost_equal (expect_rms , results ['rms' ], places = 4 )
37
36
38
37
def test_image_compare_basic ():
39
38
"""Test comparison of an image and the same image with minor differences."""
0 commit comments