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

Skip to content

Commit 7c63580

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

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines change 8000 d

lib/matplotlib/tests/test_transforms.py

Lines changed: 3 additions & 11 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 8000 _method(self):
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,10 +350,7 @@ def test_affine_simplification(self):
352350
assert_array_equal(expected_result, result)
353351

354352

355-
class TestTransformPlotInterface(unittest.TestCase):
356-
def tearDown(self):
357-
plt.close()
358-
353+
class TestTransformPlotInterface:
359354
def test_line_extent_axes_coords(self):
360355
# a simple line in axes coordinates
361356
ax = plt.axes()
@@ -381,7 +376,6 @@ def test_line_extent_compound_coords1(self):
381376
assert_array_equal(ax.dataLim.get_points(),
382377
np.array([[np.inf, -5.],
383378
[-np.inf, 35.]]))
384-
plt.close()
385379

386380
def test_line_extent_predata_transform_coords(self):
387381
# a simple line in (offset + data) coordinates
@@ -390,7 +384,6 @@ def test_line_extent_predata_transform_coords(self):
390384
ax.plot([0.1, 1.2, 0.8], [35, -5, 18], transform=trans)
391385
assert_array_equal(ax.dataLim.get_points(),
392386
np.array([[1., -50.], [12., 350.]]))
393-
plt.close()
394387

395388
def test_line_extent_compound_coords2(self):
396389
# a simple line in (offset + data) coordinates in the y component, and
@@ -401,7 +394,6 @@ def test_line_extent_compound_coords2(self):
401394
ax.plot([0.1, 1.2, 0.8], [35, -5, 18], transform=trans)
402395
assert_array_equal(ax.dataLim.get_points(),
403396
np.array([[np.inf, -50.], [-np.inf, 350.]]))
404-
plt.close()
405397

406398
def test_line_extents_affine(self):
407399
ax = plt.axes()

0 commit comments

Comments
 (0)
0