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
8000
_method (self ):
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,10 +350,7 @@ 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 ):
357
- plt .close ()
358
-
353
+ class TestTransformPlotInterface :
359
354
def test_line_extent_axes_coords (self ):
360
355
# a simple line in axes coordinates
361
356
ax = plt .axes ()
@@ -381,7 +376,6 @@ def test_line_extent_compound_coords1(self):
381
376
assert_array_equal (ax .dataLim .get_points (),
382
377
np .array ([[np .inf , - 5. ],
383
378
[- np .inf , 35. ]]))
384
- plt .close ()
385
379
386
380
def test_line_extent_predata_transform_coords (self ):
387
381
# a simple line in (offset + data) coordinates
@@ -390,7 +384,6 @@ def test_line_extent_predata_transform_coords(self):
390
384
ax .plot ([0.1 , 1.2 , 0.8 ], [35 , - 5 , 18 ], transform = trans )
391
385
assert_array_equal (ax .dataLim .get_points (),
392
386
np .array ([[1. , - 50. ], [12. , 350. ]]))
393
- plt .close ()
394
387
395
388
def test_line_extent_compound_coords2 (self ):
396
389
# a simple line in (offset + data) coordinates in the y component, and
@@ -401,7 +394,6 @@ def test_line_extent_compound_coords2(self):
401
394
ax .plot ([0.1 , 1.2 , 0.8 ], [35 , - 5 , 18 ], transform = trans )
402
395
assert_array_equal (ax .dataLim .get_points (),
403
396
np .array ([[np .inf , - 50. ], [- np .inf , 350. ]]))
404
- plt .close ()
405
397
406
398
def test_line_extents_affine (self ):
407
399
ax = plt .axes ()
0 commit comments