|
24 | 24 | from numpy.testing import (
|
25 | 25 | assert_array_equal, assert_array_almost_equal, assert_allclose)
|
26 | 26 | from matplotlib.testing.noseclasses import KnownFailureTest
|
27 |
| -from copy import copy |
| 27 | +from copy import deepcopy |
28 | 28 | from numpy import ma
|
29 | 29 | import matplotlib.image as mimage
|
30 | 30 | import matplotlib.colors as colors
|
@@ -155,6 +155,7 @@ def test_imsave():
|
155 | 155 |
|
156 | 156 | assert_array_equal(arr_dpi1, arr_dpi100)
|
157 | 157 |
|
| 158 | +@cleanup |
158 | 159 | def test_imsave_color_alpha():
|
159 | 160 | # Test that imsave accept arrays with ndim=3 where the third dimension is
|
160 | 161 | # color and alpha without raising any exceptions, and that the data is
|
@@ -698,7 +699,7 @@ def test_mask_image_over_under():
|
698 | 699 | Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
|
699 | 700 | Z = 10*(Z2 - Z1) # difference of Gaussians
|
700 | 701 |
|
701 |
| - palette = copy(plt.cm.gray) |
| 702 | + palette = deepcopy(plt.cm.gray) |
702 | 703 | palette.set_over('r', 1.0)
|
703 | 704 | palette.set_under('g', 1.0)
|
704 | 705 | palette.set_bad('b', 1.0)
|
@@ -761,7 +762,7 @@ def test_imshow_endianess():
|
761 | 762 | remove_text=True, style='default')
|
762 | 763 | def test_imshow_masked_interpolation():
|
763 | 764 |
|
764 |
| - cm = copy(plt.get_cmap('viridis')) |
| 765 | + cm = deepcopy(plt.get_cmap('viridis')) |
765 | 766 | cm.set_over('r')
|
766 | 767 | cm.set_under('b')
|
767 | 768 | cm.set_bad('k')
|
|
0 commit comments