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)
| 1535 | |
| 1536 | |
| 1537 | def 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 | |
| 1553 | def decorate_methods(cls, decorator, testmatch=None): |
no outgoing calls
searching dependent graphs…