MCPcopy Index your code
hub / github.com/pytest-dev/pytest / check_basic_matches

Function check_basic_matches

testing/typing_raises_group.py:41–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39
40
41def check_basic_matches() -> None:
42 # check that matches gets rid of the naked ValueError in the union
43 exc: ExceptionGroup[ValueError] | ValueError = ExceptionGroup("", (ValueError(),))
44 if RaisesGroup(ValueError).matches(exc):
45 assert_type(exc, ExceptionGroup[ValueError])
46
47 # also check that BaseExceptionGroup shows up for BaseExceptions
48 if RaisesGroup(KeyboardInterrupt).matches(exc):
49 assert_type(exc, BaseExceptionGroup[KeyboardInterrupt])
50
51
52def check_matches_with_different_exception_type() -> None:

Callers

nothing calls this directly

Calls 2

RaisesGroupClass · 0.90
matchesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…