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

Function test_disable_cache_warning

lib/matplotlib/tests/test_animation.py:515–531  ·  view source on GitHub ↗
(anim)

Source from the content-addressed store, hash-verified

513
514@pytest.mark.parametrize('anim', [dict(klass=dict)], indirect=['anim'])
515def test_disable_cache_warning(anim):
516 cache_frame_data = True
517 frames = iter(range(5))
518 match_target = (
519 f"{frames=!r} which we can infer the length of, "
520 "did not pass an explicit *save_count* "
521 f"and passed {cache_frame_data=}. To avoid a possibly "
522 "unbounded cache, frame data caching has been disabled. "
523 "To suppress this warning either pass "
524 "`cache_frame_data=False` or `save_count=MAX_FRAMES`."
525 )
526 with pytest.warns(UserWarning, match=re.escape(match_target)):
527 anim = animation.FuncAnimation(
528 **{**anim, 'cache_frame_data': cache_frame_data, 'frames': frames}
529 )
530 assert anim._cache_frame_data is False
531 anim._init_draw()
532
533
534def test_movie_writer_invalid_path(anim):

Callers

nothing calls this directly

Calls 1

_init_drawMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…