Skip to content

Commit 0c1c928

Browse files
committed
add teardown method to close any open windows
1 parent ae7531b commit 0c1c928

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

spatialmath/base/test_transforms.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252

5353
class TestVector(unittest.TestCase):
5454

55+
@classmethod
56+
def tearDownClass(cls):
57+
plt.close('all')
58+
5559
def test_unit(self):
5660

5761
nt.assert_array_almost_equal(unitvec([1, 0, 0]), np.r_[1, 0, 0])

spatialmath/test_pose2d.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ def array_compare(x, y):
2626

2727
class TestSO2(unittest.TestCase):
2828

29+
@classmethod
30+
def tearDownClass(cls):
31+
plt.close('all')
2932

3033
def test_constructor(self):
3134

@@ -224,7 +227,11 @@ def test_plot(self):
224227

225228

226229
class TestSE2(unittest.TestCase):
227-
230+
231+
@classmethod
232+
def tearDownClass(cls):
233+
plt.close('all')
234+
228235
def test_constructor(self):
229236

230237
self.assertIsInstance(SE2(), SE2)

spatialmath/test_pose3d.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ def array_compare(x, y):
2525

2626

2727
class TestSO3(unittest.TestCase):
28+
@classmethod
29+
def tearDownClass(cls):
30+
plt.close('all')
2831

2932
def test_constructor(self):
3033

@@ -569,6 +572,10 @@ def test_functions_vect(self):
569572

570573
class TestSE3(unittest.TestCase):
571574

575+
@classmethod
576+
def tearDownClass(cls):
577+
plt.close('all')
578+
572579
def test_constructor(self):
573580

574581
# null constructor

0 commit comments

Comments
 (0)