MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_invalid_input_forms

Function test_invalid_input_forms

lib/matplotlib/tests/test_cycles.py:149–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

147
148
149def test_invalid_input_forms():
150 fig, ax = plt.subplots()
151
152 with pytest.raises((TypeError, ValueError)):
153 ax.set_prop_cycle(1)
154 with pytest.raises((TypeError, ValueError)):
155 ax.set_prop_cycle([1, 2])
156
157 with pytest.raises((TypeError, ValueError)):
158 ax.set_prop_cycle('color', 'fish')
159
160 with pytest.raises((TypeError, ValueError)):
161 ax.set_prop_cycle('linewidth', 1)
162 with pytest.raises((TypeError, ValueError)):
163 ax.set_prop_cycle('linewidth', {1, 2})
164 with pytest.raises((TypeError, ValueError)):
165 ax.set_prop_cycle(linewidth=1, color='r')
166
167 with pytest.raises((TypeError, ValueError)):
168 ax.set_prop_cycle('foobar', [1, 2])
169 with pytest.raises((TypeError, ValueError)):
170 ax.set_prop_cycle(foobar=[1, 2])
171
172 with pytest.raises((TypeError, ValueError)):
173 ax.set_prop_cycle(cycler(foobar=[1, 2]))
174 with pytest.raises(ValueError):
175 ax.set_prop_cycle(cycler(color='rgb', c='cmy'))

Callers

nothing calls this directly

Calls 3

cyclerFunction · 0.85
subplotsMethod · 0.45
set_prop_cycleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…