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

Function assert_raises

extra_tests/snippets/testutils.py:5–12  ·  view source on GitHub ↗
(expected, *args, _msg=None, **kw)

Source from the content-addressed store, hash-verified

3
4
5def assert_raises(expected, *args, _msg=None, **kw):
6 if args:
7 f, f_args = args[0], args[1:]
8 with AssertRaises(expected, _msg):
9 f(*f_args, **kw)
10 else:
11 assert not kw
12 return AssertRaises(expected, _msg)
13
14
15class AssertRaises:

Callers 15

stdlib_binascii.pyFile · 0.90
import.pyFile · 0.90
stdlib_json.pyFile · 0.90
builtin_float.pyFile · 0.90
recursion.pyFile · 0.90
builtin_complex.pyFile · 0.90
syntax_invalid.pyFile · 0.90

Calls 2

AssertRaisesClass · 0.85
fFunction · 0.70

Tested by

no test coverage detected