Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b35663d

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

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

lib/matplotlib/tests/test_cycles.py

Lines 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)