| 3506 | # Reimplemented to provide special behavior when |
| 3507 | # _ignore_not_implemented_error is True |
| 3508 | def assertRaises(self, expected_exception, *args, **kwargs): |
| 3509 | if self._ignore_not_implemented_error: |
| 3510 | context: Optional[AssertRaisesContextIgnoreNotImplementedError] = \ |
| 3511 | AssertRaisesContextIgnoreNotImplementedError(expected_exception, self) # type: ignore[call-arg] |
| 3512 | try: |
| 3513 | return context.handle('assertRaises', args, kwargs) # type: ignore[union-attr] |
| 3514 | finally: |
| 3515 | # see https://bugs.python.org/issue23890 |
| 3516 | context = None |
| 3517 | else: |
| 3518 | return super().assertRaises(expected_exception, *args, **kwargs) |
| 3519 | |
| 3520 | # Reimplemented to provide special behavior when |
| 3521 | # _ignore_not_implemented_error is True |