From 4a6d76c557caf7263ab57e5fe840d28aa3356621 Mon Sep 17 00:00:00 2001 From: jaseg Date: Mon, 24 Jan 2022 11:55:19 +0100 Subject: Improve error messages --- gerbonara/gerber/tests/test_excellon.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gerbonara/gerber/tests/test_excellon.py') diff --git a/gerbonara/gerber/tests/test_excellon.py b/gerbonara/gerber/tests/test_excellon.py index fb0ebb8..fb25d8f 100644 --- a/gerbonara/gerber/tests/test_excellon.py +++ b/gerbonara/gerber/tests/test_excellon.py @@ -94,4 +94,12 @@ def test_gerber_alignment(reference, tmpfile, print_on_error): assert matches > 10 assert matches/total > 0.5 +@filter_syntax_warnings +def test_syntax_error(): + ref = reference_path('test_syntax_error.exc') + with pytest.raises(SyntaxError) as exc_info: + ExcellonFile.open(ref) + + assert 'test_syntax_error.exc' in exc_info.value.msg + assert '12' in exc_info.value.msg # lineno -- cgit