MCPcopy Index your code
hub / github.com/numpy/numpy / assert_raises_regex

Function assert_raises_regex

numpy/testing/_private/utils.py:1537–1550  ·  view source on GitHub ↗

assert_raises_regex(exception_class, expected_regexp, callable, *args, **kwargs) assert_raises_regex(exception_class, expected_regexp) Fail unless an exception of class exception_class and with message that matches expected_regexp is thrown by callable when

(exception_class, expected_regexp, *args, **kwargs)

Source from the content-addressed store, hash-verified

1535
1536
1537def assert_raises_regex(exception_class, expected_regexp, *args, **kwargs):
1538 """
1539 assert_raises_regex(exception_class, expected_regexp, callable, *args,
1540 **kwargs)
1541 assert_raises_regex(exception_class, expected_regexp)
1542
1543 Fail unless an exception of class exception_class and with message that
1544 matches expected_regexp is thrown by callable when invoked with arguments
1545 args and keyword arguments kwargs.
1546
1547 Alternatively, can be used as a context manager like `assert_raises`.
1548 """
1549 __tracebackhide__ = True # Hide traceback for py.test
1550 return _d.assertRaisesRegex(exception_class, expected_regexp, *args, **kwargs)
1551
1552
1553def decorate_methods(cls, decorator, testmatch=None):

Callers 15

test_exceptionsMethod · 0.90
test_stackFunction · 0.90
test_invalid_nestingMethod · 0.90
test_empty_listsMethod · 0.90
test_tupleMethod · 0.90
test_methodMethod · 0.90
test_not_implementedMethod · 0.90
test_not_implementedMethod · 0.90

Calls

no outgoing calls

Tested by 15

test_exceptionsMethod · 0.72
test_stackFunction · 0.72
test_invalid_nestingMethod · 0.72
test_empty_listsMethod · 0.72
test_tupleMethod · 0.72
test_methodMethod · 0.72
test_not_implementedMethod · 0.72
test_not_implementedMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…