8000 Move pie tests together. · matplotlib/matplotlib@b197b7d · GitHub
[go: up one dir, main page]

Skip to content

Commit b197b7d

Browse files
committed
Move pie tests together.
1 parent 152aab5 commit b197b7d

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4500,6 +4500,28 @@ def test_pie_textprops():
45004500
assert tx.get_color() == textprops["color"]
45014501

45024502

4503+
def test_pie_get_negative_values():
4504+
# Test the ValueError raised when feeding negative values into axes.pie
4505+
fig, ax = plt.subplots()
4506+
with pytest.raises(ValueError):
4507+
ax.pie([5, 5, -3], explode=[0, .1, .2])
4508+
4509+
4510+
def test_normalize_kwarg_warn_pie():
4511+
fig, ax = plt.subplots()
4512+
with pytest.warns(MatplotlibDeprecationWarning):
4513+
ax.pie(x=[0], normalize=None)
4514+
4515+
4516+
def test_normalize_kwarg_pie():
4517+
fig, ax = plt.subplots()
4518+
x = [0.3, 0.3, 0.1]
4519+
t1 = ax.pie(x=x, normalize=True)
4520+
assert abs(t1[0][-1].theta2 - 360.) < 1e-3
4521+
t2 = ax.pie(x=x, normalize=False)
4522+
assert abs(t2[0][-1].theta2 - 360.) > 1e-3
4523+
4524+
45034525
@image_comparison(['set_get_ticklabels.png'])
45044526
def test_set_get_ticklabels():
45054527
# test issue 2246
@@ -6208,13 +6230,6 @@ def test_bbox_aspect_axes_init():
62086230
assert_allclose(sizes, sizes[0])
62096231

62106232

6211-
def test_pie_get_negative_values():
6212-
# Test the ValueError raised when feeding negative values into axes.pie
6213-
fig, ax = plt.subplots()
6214-
with pytest.raises(ValueError):
6215-
ax.pie([5, 5, -3], explode=[0, .1, .2])
6216-
6217-
62186233
def test_invisible_axes():
62196234
# invisible axes should not respond to events...
62206235
fig, ax = plt.subplots()
@@ -6275,18 +6290,3 @@ def test_polar_interpolation_steps_variable_r(fig_test, fig_ref):
62756290
l.get_path()._interpolation_steps = 100
62766291
fig_ref.add_subplot(projection="polar").plot(
62776292
np.linspace(0, np.pi/2, 101), np.linspace(1, 2, 101))
6278-
6279-
6280-
def test_normalize_kwarg_warn_pie():
6281-
fig, ax = plt.subplots()
6282-
with pytest.warns(MatplotlibDeprecationWarning):
6283-
ax.pie(x=[0], normalize=None)
6284-
6285-
6286-
def test_normalize_kwarg_pie():
6287-
fig, ax = plt.subplots()
6288-
x = [0.3, 0.3, 0.1]
6289-
t1 = ax.pie(x=x, normalize=True)
6290-
assert abs(t1[0][-1].theta2 - 360.) < 1e-3
6291-
t2 = ax.pie(x=x, normalize=False)
6292-
assert abs(t2[0][-1].theta2 - 360.) > 1e-3

0 commit comments

Comments
 (0)
0