(self)
| 832 | ]) |
| 833 | |
| 834 | def test_builtin_exception(self): |
| 835 | msg = 'error!' |
| 836 | try: |
| 837 | raise Exception |
| 838 | except Exception as exc: |
| 839 | caught = exc |
| 840 | special = { |
| 841 | BaseExceptionGroup: (msg, [caught]), |
| 842 | ExceptionGroup: (msg, [caught]), |
| 843 | UnicodeError: (None, msg, None, None, None), |
| 844 | UnicodeEncodeError: ('utf-8', '', 1, 3, msg), |
| 845 | UnicodeDecodeError: ('utf-8', b'', 1, 3, msg), |
| 846 | UnicodeTranslateError: ('', 1, 3, msg), |
| 847 | } |
| 848 | exceptions = [] |
| 849 | for cls in EXCEPTION_TYPES: |
| 850 | args = special.get(cls) or (msg,) |
| 851 | exceptions.append(cls(*args)) |
| 852 | |
| 853 | self.assert_roundtrip_equal(exceptions) |
| 854 | |
| 855 | |
| 856 | class MarshalTests(_GetXIDataTests): |
nothing calls this directly
no test coverage detected