diff --git a/lib/matplotlib/tests/test_agg.py b/lib/matplotlib/tests/test_agg.py index 545340db20c5..68ec0c4fda3e 100644 --- a/lib/matplotlib/tests/test_agg.py +++ b/lib/matplotlib/tests/test_agg.py @@ -286,50 +286,46 @@ def test_chunksize_fails(): w = 5*dpi h = 6*dpi - # just fit in the width + # make a Path that spans the whole w-h rectangle x = np.linspace(0, w, N) - # and go top-to-bottom y = np.ones(N) * h y[::2] = 0 + path = Path(np.vstack((x, y)).T) + # effectively disable path simplification (but leaving it "on") + path.simplify_threshold = 0 - idt = IdentityTransform() - # make a renderer + # setup the minimal GraphicsContext to draw a Path ra = RendererAgg(w, h, dpi) - # setup the minimal gc to draw a line gc = ra.new_gc() gc.set_linewidth(1) gc.set_foreground('r') - # make a Path - p = Path(np.vstack((x, y)).T) - # effectively disable path simplification (but leaving it "on") - p.simplify_threshold = 0 gc.set_hatch('/') - with pytest.raises(OverflowError, match='hatched path'): - ra.draw_path(gc, p, idt) + with pytest.raises(OverflowError, match='can not split hatched path'): + ra.draw_path(gc, path, IdentityTransform()) gc.set_hatch(None) - with pytest.raises(OverflowError, match='filled path'): - ra.draw_path(gc, p, idt, (1, 0, 0)) + with pytest.raises(OverflowError, match='can not split filled path'): + ra.draw_path(gc, path, IdentityTransform(), (1, 0, 0)) # Set to zero to disable, currently defaults to 0, but let's be sure. with rc_context({'agg.path.chunksize': 0}): with pytest.raises(OverflowError, match='Please set'): - ra.draw_path(gc, p, idt) + ra.draw_path(gc, path, IdentityTransform()) # Set big enough that we do not try to chunk. with rc_context({'agg.path.chunksize': 1_000_000}): with pytest.raises(OverflowError, match='Please reduce'): - ra.draw_path(gc, p, idt) + ra.draw_path(gc, path, IdentityTransform()) # Small enough we will try to chunk, but big enough we will fail to render. with rc_context({'agg.path.chunksize': 90_000}): with pytest.raises(OverflowError, match='Please reduce'): - ra.draw_path(gc, p, idt) + ra.draw_path(gc, path, IdentityTransform()) - p.should_simplify = False + path.should_simplify = False with pytest.raises(OverflowError, match="should_simplify is False"): - ra.draw_path(gc, p, idt) + ra.draw_path(gc, path, IdentityTransform()) def test_non_tuple_rgbaface():