Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5c48037

Browse filesBrowse files
committed
Add unit tests
1 parent ec6014f commit 5c48037
Copy full SHA for 5c48037

File tree

Expand file treeCollapse file tree

1 file changed

+21
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+21
-0
lines changed

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6149,6 +6149,27 @@ def test_pie_get_negative_values():
61496149
ax.pie([5, 5, -3], explode=[0, .1, .2])
61506150

61516151

6152+
def test_pie_invalid_explode():
6153+
# Test ValueError raised when feeding short explode list to axes.pie
6154+
fig, ax = plt.subplots()
6155+
with pytest.raises(ValueError):
6156+
ax.pie([1, 2, 3], explode=[0.1, 0.1])
6157+
6158+
6159+
def test_pie_invalid_labels():
6160+
# Test ValueError raised when feeding short labels list to axes.pie
6161+
fig, ax = plt.subplots()
6162+
with pytest.raises(ValueError):
6163+
ax.pie([1, 2, 3], labels=["One", "Two"])
6164+
6165+
6166+
def test_pie_invalid_radius():
6167+
# Test ValueError raised when feeding negative radius to axes.pie
6168+
fig, ax = plt.subplots()
6169+
with pytest.raises(ValueError):
6170+
ax.pie([1, 2, 3], radius=-5)
6171+
6172+
61526173
def test_normalize_kwarg_pie():
61536174
fig, ax = plt.subplots()
61546175
x = [0.3, 0.3, 0.1]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.