Skip to content

Commit 52f7610

Browse files
tacaswellanntzer
andcommitted
DOC: improve clarity of error messages
Co-authored-by: Antony Lee <anntzer.lee@gmail.com>
1 parent 6cfa6ed commit 52f7610

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/matplotlib/backends/backend_agg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ def draw_path(self, gc, path, transform, rgbFace=None):
170170
except OverflowError as err:
171171
cant_chunk = ''
172172
if rgbFace is not None:
173-
cant_chunk += "- can not split path with rgbFace\n"
173+
cant_chunk += "- can not split filled path\n"
174174
if gc.get_hatch() is not None:
175-
cant_chunk += "- can not split path with hatch\n"
175+
cant_chunk += "- can not split hatched path\n"
176176
if not path.should_simplify:
177-
cant_chunk += "- this path says it can't be simplified\n"
177+
cant_chunk += "- path.should_simplify is False\n"
178178
if len(cant_chunk):
179179
msg = ("Exceeded cell block limit in Agg, however "
180180
"for the following reasons:\n\n"

lib/matplotlib/tests/test_agg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,21 +282,21 @@ def test_chunksize_hatch_fail(chunk_limit_setup):
282282

283283
gc.set_hatch('/')
284284

285-
with pytest.raises(OverflowError, match='with hatch'):
285+
with pytest.raises(OverflowError, match='hatched path'):
286286
ra.draw_path(gc, p, idt)
287287

288288

289289
def test_chunksize_rgbFace_fail(chunk_limit_setup):
290290
ra, gc, p, idt = chunk_limit_setup
291291

292-
with pytest.raises(OverflowError, match='with rgbFace'):
292+
with pytest.raises(OverflowError, match='filled path'):
293293
ra.draw_path(gc, p, idt, (1, 0, 0))
294294

295295

296296
def test_chunksize_no_simplify_fail(chunk_limit_setup):
297297
ra, gc, p, idt = chunk_limit_setup
298298
p.should_simplify = False
299-
with pytest.raises(OverflowError, match="can't be simplified"):
299+
with pytest.raises(OverflowError, match="should_simplify is False"):
300300
ra.draw_path(gc, p, idt)
301301

302302

0 commit comments

Comments
 (0)