MCPcopy
hub / github.com/pytest-dev/pytest / check_message

Function check_message

testing/python/raises_group.py:482–493  ·  view source on GitHub ↗
(
        message: str,
        body: RaisesGroup[BaseException],
    )

Source from the content-addressed store, hash-verified

480
481def test_message() -> None:
482 def check_message(
483 message: str,
484 body: RaisesGroup[BaseException],
485 ) -> None:
486 with (
487 pytest.raises(
488 Failed,
489 match=f"^DID NOT RAISE any exception, expected `{re.escape(message)}`$",
490 ),
491 body,
492 ):
493 ...
494
495 # basic
496 check_message("ExceptionGroup(ValueError)", RaisesGroup(ValueError))

Callers 1

test_messageFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_messageFunction · 0.68