8000 Remove remaining unittest.TestCase uses · matplotlib/matplotlib@ecb5423 · GitHub
[go: up one dir, main page]

Skip to content

Commit ecb5423

Browse files
committed
Remove remaining unittest.TestCase uses
1 parent 6f1ffeb commit ecb5423

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

lib/matplotlib/tests/test_transforms.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import unittest
2-
31
import numpy as np
42
from numpy.testing import (assert_allclose, assert_almost_equal,
53
assert_array_equal, assert_array_almost_equal)
@@ -219,8 +217,8 @@ def transform_path_non_affine(self, path):
219217
return self.real_trans.transform_path(path)
220218

221219

222-
class BasicTransformTests(unittest.TestCase):
223-
def setUp(self):
220+
class BasicTransformTests():
221+
def setup_method(self 8000 ):
224222

225223
self.ta1 = mtransforms.Affine2D(shorthand_name='ta1').rotate(np.pi / 2)
226224
self.ta2 = mtransforms.Affine2D(shorthand_name='ta2').translate(10, 0)
@@ -352,8 +350,8 @@ def test_affine_simplification(self):
352350
assert_array_equal(expected_result, result)
353351

354352

355-
class TestTransformPlotInterface(unittest.TestCase):
356-
def tearDown(self):
353+
class TestTransformPlotInterface:
354+
def teardown_method(self):
357355
plt.close()
358356

359357
def test_line_extent_axes_coords(self):
@@ -381,7 +379,6 @@ def test_line_extent_compound_coords1(self):
381379
assert_array_equal(ax.dataLim.get_points(),
382380
np.array([[np.inf, -5.],
383381
[-np.inf, 35.]]))
384-
plt.close()
385382

386383
def test_line_extent_predata_transform_coords(self):
387384
# a simple line in (offset + data) coordinates
@@ -390,7 +387,6 @@ def test_line_extent_predata_transform_coords(self):
390387
ax.plot([0.1, 1.2, 0.8], [35, -5, 18], transform=trans)
391388
assert_array_equal(ax.dataLim.get_points(),
392389
np.array([[1., -50.], [12., 350.]]))
393-
plt.close()
394390

395391
def test_line_extent_compound_coords2(self):
396392
# a simple line in (offset + data) coordinates in the y component, and
@@ -401,7 +397,6 @@ def test_line_extent_compound_coords2(self):
401397
ax.plot([0.1, 1.2, 0.8], [35, -5, 18], transform=trans)
402398
assert_array_equal(ax.dataLim.get_points(),
403399
np.array([[np.inf, -50.], [-np.inf, 350.]]))
404-
plt.close()
405400

406401
def test_line_extents_affine(self):
407402
ax = plt.axes()

0 commit comments

Comments
 (0)
0