8000 Remove remaining unittest.TestCase uses by timhoffm · Pull Request #14330 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Remove remaining unittest.TestCase uses #14330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions lib/matplotlib/tests/test_transforms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import unittest

import numpy as np
from numpy.testing import (assert_allclose, assert_almost_equal,
assert_array_equal, assert_array_almost_equal)
Expand Down Expand Up @@ -219,8 +217,8 @@ def transform_path_non_affine(self, path):
return self.real_trans.transform_path(path)


class BasicTransformTests(unittest.TestCase):
def setUp(self):
class TestBasicTransform():
def setup_method(self):

self.ta1 = mtransforms.Affine2D(shorthand_name='ta1').rotate(np.pi / 2)
self.ta2 = mtransforms.Affine2D(shorthand_name='ta2').translate(10, 0)
Expand Down Expand Up @@ -352,10 +350,7 @@ def test_affine_simplification(self):
assert_array_equal(expected_result, result)


class TestTransformPlotInterface(unittest.TestCase):
def tearDown(self):
plt.close()

class TestTransformPlotInterface:
def test_line_extent_axes_coords(self):
# a simple line in axes coordinates
ax = plt.axes()
Expand All @@ -381,7 +376,6 @@ def test_line_extent_compound_coords1(self):
assert_array_equal(ax.dataLim.get_points(),
np.array([[np.inf, -5.],
[-np.inf, 35.]]))
plt.close()

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

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

def test_line_extents_affine(self):
ax = plt.axes()
Expand Down
0