1
- import unittest
2
-
3
1
import numpy as np
4
2
from numpy .testing import (assert_allclose , assert_almost_equal ,
5
3
assert_array_equal , assert_array_almost_equal )
@@ -219,8 +217,8 @@ def transform_path_non_affine(self, path):
219
217
return self .real_trans .transform_path (path )
220
218
221
219
222
- class BasicTransformTests (unittest . TestCase ):
223
- def setUp (self ):
220
+ class BasicTransformTests ():
221
+ def setup_method (self
8000
):
224
222
225
223
self .ta1 = mtransforms .Affine2D (shorthand_name = 'ta1' ).rotate (np .pi / 2 )
226
224
self .ta2 = mtransforms .Affine2D (shorthand_name = 'ta2' ).translate (10 , 0 )
@@ -352,8 +350,8 @@ def test_affine_simplification(self):
352
350
assert_array_equal (expected_result , result )
353
351
354
352
355
- class TestTransformPlotInterface ( unittest . TestCase ) :
356
- def tearDown (self ):
353
+ class TestTransformPlotInterface :
354
+ def teardown_method (self ):
357
355
plt .close ()
358
356
359
357
def test_line_extent_axes_coords (self ):
@@ -381,7 +379,6 @@ def test_line_extent_compound_coords1(self):
381
379
assert_array_equal (ax .dataLim .get_points (),
382
380
np .array ([[np .inf , - 5. ],
383
381
[- np .inf , 35. ]]))
384
- plt .close ()
385
382
386
383
def test_line_extent_predata_transform_coords (self ):
387
384
# a simple line in (offset + data) coordinates
@@ -390,7 +387,6 @@ def test_line_extent_predata_transform_coords(self):
390
387
ax .plot ([0.1 , 1.2 , 0.8 ], [35 , - 5 , 18 ], transform = trans )
391
388
assert_array_equal (ax .dataLim .get_points (),
392
389
np .array ([[1. , - 50. ], [12. , 350. ]]))
393
- plt .close ()
394
390
395
391
def test_line_extent_compound_coords2 (self ):
396
392
# a simple line in (offset + data) coordinates in the y component, and
@@ -401,7 +397,6 @@ def test_line_extent_compound_coords2(self):
401
397
ax .plot ([0.1 , 1.2 , 0.8 ], [35 , - 5 , 18 ], transform = trans )
402
398
assert_array_equal (ax .dataLim .get_points (),
403
399
np .array ([[np .inf , - 50. ], [- np .inf , 350. ]]))
404
- plt .close ()
405
400
406
401
def test_line_extents_affine (self ):
407
402
ax = plt .axes ()
0 commit comments