@@ -286,50 +286,46 @@ def test_chunksize_fails():
286
286
w = 5 * dpi
287
287
h = 6 * dpi
288
288
289
- # just fit in the width
289
+ # make a Path that spans the whole w-h rectangle
290
290
x = np .linspace (0 , w , N )
291
- # and go top-to-bottom
292
291
y = np .ones (N ) * h
293
292
y [::2 ] = 0
293
+ path = Path (np .vstack ((x , y )).T )
294
+ # effectively disable path simplification (but leaving it "on")
295
+ path .simplify_threshold = 0
294
296
295
- idt = IdentityTransform ()
296
- # make a renderer
297
+ # setup the minimal GraphicsContext to draw a Path
297
298
ra = RendererAgg (w , h , dpi )
298
- # setup the minimal gc to draw a line
299
299
gc = ra .new_gc ()
300
300
gc .set_linewidth (1 )
301
301
gc .set_foreground ('r' )
302
- # make a Path
303
- p = Path (np .vstack ((x , y )).T )
304
- # effectively disable path simplification (but leaving it "on")
305
- p .simplify_threshold = 0
306
302
307
303
gc .set_hatch ('/' )
308
- with pytest .raises (OverflowError , match = 'hatched path' ):
309
- ra .draw_path (gc , p , idt )
304
+ with pytest .raises (OverflowError , match = 'can not split hatched path' ):
305
+ ra .draw_path (gc , path , IdentityTransform () )
310
306
gc .set_hatch (None )
311
307
312
- with pytest .raises (OverflowError , match = 'filled path' ):
313
- ra .draw_path (gc , p , idt , (1 , 0 , 0 ))
308
+ with pytest .raises (OverflowError , match = 'can not split filled path' ):
309
+ ra .draw_path (gc , path , IdentityTransform () , (1 , 0 , 0 ))
314
310
315
311
# Set to zero to disable, currently defaults to 0, but let's be sure.
316
312
with rc_context ({'agg.path.chunksize' : 0 }):
317
313
with pytest .raises (OverflowError , match = 'Please set' ):
318
- ra .draw_path (gc , p , idt )
314
+ ra .draw_path (gc , path , IdentityTransform () )
319
315
320
316
# Set big enough that we do not try to chunk.
321
317
with rc_context ({'agg.path.chunksize' : 1_000_000 }):
322
318
with pytest .raises (OverflowError , match = 'Please reduce' ):
323
- ra .draw_path (gc , p , idt )
319
+ ra .draw_path (gc , path , IdentityTransform () )
324
320
325
321
# Small enough we will try to chunk, but big enough we will fail to render.
326
322
with rc_context ({'agg.path.chunksize' : 90_000 }):
327
323
with pytest .raises (OverflowError , match = 'Please reduce' ):
328
- ra .draw_path (gc , p , idt )
324
+ ra .draw_path (gc , path , IdentityTransform () )
329
325
330
- p .should_simplify = False
326
+ path .should_simplify = False
331
327
with pytest .raises (OverflowError , match = "should_simplify is False" ):
332
- ra .draw_path (gc , p , idt )
328
+ ra .draw_path (gc , path , IdentityTransform () )
333
329
334
330
335
331
def test_non_tuple_rgbaface ():
0 commit comments