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 b35663d

Browse filesBrowse files
WeatherGodmdboom
authored andcommitted
Converted context-based tests to non-context-based tests for the v1.5.x branch
1 parent ab100f4 commit b35663d
Copy full SHA for b35663d

File tree

Expand file treeCollapse file tree

1 file changed

+8
-12
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-12
lines changed

‎lib/matplotlib/tests/test_cycles.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_cycles.py
+8-12Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,14 @@ def test_valid_input_forms():
150150
@cleanup
151151
def test_invalid_input_forms():
152152
fig, ax = plt.subplots()
153-
with assert_raises((TypeError, ValueError)):
154-
ax.set_prop_cycle(1)
155-
with assert_raises((TypeError, ValueError)):
156-
ax.set_prop_cycle([1, 2])
157-
with assert_raises((TypeError, ValueError)):
158-
ax.set_prop_cycle('color', 'fish')
159-
with assert_raises((TypeError, ValueError)):
160-
ax.set_prop_cycle('linewidth', 1)
161-
with assert_raises((TypeError, ValueError)):
162-
ax.set_prop_cycle('linewidth', {'1': 1, '2': 2})
163-
with assert_raises((TypeError, ValueError)):
164-
ax.set_prop_cycle(linewidth=1, color='r')
153+
assert_raises((TypeError, ValueError), ax.set_prop_cycle, 1)
154+
assert_raises((TypeError, ValueError), ax.set_prop_cycle, [1, 2])
155+
assert_raises((TypeError, ValueError), ax.set_prop_cycle, 'color', 'fish')
156+
assert_raises((TypeError, ValueError), ax.set_prop_cycle, 'linewidth', 1)
157+
assert_raises((TypeError, ValueError), ax.set_prop_cycle,
158+
'linewidth', {'1': 1, '2': 2})
159+
assert_raises((TypeError, ValueError), ax.set_prop_cycle,
160+
linewidth=1, color='r')
165161

166162

167163
if __name__ == '__main__':

0 commit comments

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