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

Function test_set_alpha_for_array

lib/matplotlib/tests/test_artist.py:341–352  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

339
340
341def test_set_alpha_for_array():
342 art = martist.Artist()
343 with pytest.raises(TypeError, match='^alpha must be numeric or None'):
344 art._set_alpha_for_array('string')
345 with pytest.raises(ValueError, match="outside 0-1 range"):
346 art._set_alpha_for_array(1.1)
347 with pytest.raises(ValueError, match="outside 0-1 range"):
348 art._set_alpha_for_array(np.nan)
349 with pytest.raises(ValueError, match="alpha must be between 0 and 1"):
350 art._set_alpha_for_array([0.5, 1.1])
351 with pytest.raises(ValueError, match="alpha must be between 0 and 1"):
352 art._set_alpha_for_array([0.5, np.nan])
353
354
355def test_callbacks():

Callers

nothing calls this directly

Calls 1

_set_alpha_for_arrayMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…