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

Method _repr_expected

src/_pytest/raises.py:1235–1240  ·  view source on GitHub ↗

Get the repr of an expected type/RaisesExc/RaisesGroup, but we only want the name if it's a type

(e: type[BaseException] | AbstractRaises[BaseException])

Source from the content-addressed store, hash-verified

1233
1234 @staticmethod
1235 def _repr_expected(e: type[BaseException] | AbstractRaises[BaseException]) -> str:
1236 """Get the repr of an expected type/RaisesExc/RaisesGroup, but we only want
1237 the name if it's a type"""
1238 if isinstance(e, type):
1239 return _exception_type_name(e)
1240 return repr(e)
1241
1242 @overload
1243 def _check_exceptions(

Callers 2

matchesMethod · 0.95
_check_exceptionsMethod · 0.95

Calls 1

_exception_type_nameFunction · 0.85

Tested by

no test coverage detected