Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
36bac55
Rework error handling
erlend-aasland Jul 29, 2023
9cb2ce9
Merge branch 'main' into clinic/warn-and-fail
erlend-aasland Jul 31, 2023
789f5ee
Adapt new test
erlend-aasland Jul 31, 2023
15a246b
Pull in main
erlend-aasland Aug 1, 2023
e32d221
Pull in main
erlend-aasland Aug 1, 2023
4350ecc
Align with Alex's changes
erlend-aasland Aug 1, 2023
ad5181a
Address review: pass iso. ellipse
erlend-aasland Aug 1, 2023
545e7b6
Address review: add return annotation
erlend-aasland Aug 1, 2023
c978a6d
Address review: re.escape
erlend-aasland Aug 1, 2023
33b038c
Address review: fix test
erlend-aasland Aug 1, 2023
7b631a3
Refactor: extract method parse_parameter_name()
erlend-aasland Aug 1, 2023
553cb6e
Address review: re.escape better
erlend-aasland Aug 2, 2023
1514f63
Address review: UserWarning iso. Warning
erlend-aasland Aug 2, 2023
d3daef7
Revert "Refactor: extract method parse_parameter_name()"
erlend-aasland Aug 2, 2023
aa38570
Pull in main
erlend-aasland Aug 2, 2023
8f3750b
Print debug stuff to stderr
AlexWaygood Aug 2, 2023
e8b8d7e
Adapt test
erlend-aasland Aug 2, 2023
79b9859
Print to stdout instead of using warnings.warn
erlend-aasland Aug 2, 2023
57eff9d
Final touches
erlend-aasland Aug 2, 2023
5b8dea9
Pull in main
erlend-aasland Aug 2, 2023
6f5cfae
Fix merge
erlend-aasland Aug 2, 2023
3081729
Try to produce correct line numbers in error messages
erlend-aasland Aug 2, 2023
716bda8
Fixup CLI error formatting
erlend-aasland Aug 2, 2023
af79481
Fix reraise of ClinicError in parse()
erlend-aasland Aug 2, 2023
d109b63
Adjust tests again
erlend-aasland Aug 2, 2023
ecbfe2c
Remove unused import
erlend-aasland Aug 2, 2023
90e1bc9
Mutate the exception
erlend-aasland Aug 2, 2023
7766c3d
Share more code between the `warn()` and `fail()` branches (#49)
AlexWaygood Aug 2, 2023
3d9d6c6
Pull in main
erlend-aasland Aug 2, 2023
8573928
Pull in main
erlend-aasland Aug 2, 2023
fcd4721
Add docstring to _expect_failure
erlend-aasland Aug 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add docstring to _expect_failure
  • Loading branch information
erlend-aasland committed Aug 2, 2023
commit fcd472104ed00e32ff733d45df9ececfacc60632
9 changes: 9 additions & 0 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@


def _expect_failure(tc, parser, code, errmsg, *, filename=None, lineno=None):
"""Helper for the parser tests.

tc: unittest.TestCase; passed self in the wrapper
parser: the clinic parser used for this test case
code: a str with input text (clinic code)
errmsg: the expected error message
filename: str, optional filename
lineno: int, optional line number
"""
code = dedent(code).strip()
errmsg = re.escape(errmsg)
with tc.assertRaisesRegex(clinic.ClinicError, errmsg) as cm:
Expand Down