MCPcopy Index your code
hub / github.com/RustPython/RustPython / raises

Method raises

Lib/test/test_descr.py:989–999  ·  view source on GitHub ↗
(exc, expected, callable, *args)

Source from the content-addressed store, hash-verified

987 "order (MRO) for bases ")
988
989 def raises(exc, expected, callable, *args):
990 try:
991 callable(*args)
992 except exc as msg:
993 # the exact msg is generally considered an impl detail
994 if support.check_impl_detail():
995 if not str(msg).startswith(expected):
996 self.fail("Message %r, expected %r" %
997 (str(msg), expected))
998 else:
999 self.fail("Expected %s" % exc)
1000
1001 class A(object): pass
1002 class B(A): pass

Callers

nothing calls this directly

Calls 4

callableFunction · 0.85
strFunction · 0.85
startswithMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected