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

Method test_exceptions

Lib/test/test_pickle.py:779–815  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

777
778 @unittest.expectedFailure # TODO: RUSTPYTHON
779 def test_exceptions(self):
780 self.assertEqual(mapping('exceptions', 'StandardError'),
781 ('builtins', 'Exception'))
782 self.assertEqual(mapping('exceptions', 'Exception'),
783 ('builtins', 'Exception'))
784 self.assertEqual(reverse_mapping('builtins', 'Exception'),
785 ('exceptions', 'Exception'))
786 self.assertEqual(mapping('exceptions', 'OSError'),
787 ('builtins', 'OSError'))
788 self.assertEqual(reverse_mapping('builtins', 'OSError'),
789 ('exceptions', 'OSError'))
790
791 for name, exc in get_exceptions(builtins):
792 with self.subTest(name):
793 if exc in (BlockingIOError,
794 ResourceWarning,
795 StopAsyncIteration,
796 PythonFinalizationError,
797 RecursionError,
798 EncodingWarning,
799 BaseExceptionGroup,
800 ExceptionGroup,
801 _IncompleteInputError):
802 continue
803 if exc is not OSError and issubclass(exc, OSError):
804 self.assertEqual(reverse_mapping('builtins', name),
805 ('exceptions', 'OSError'))
806 elif exc is not ImportError and issubclass(exc, ImportError):
807 self.assertEqual(reverse_mapping('builtins', name),
808 ('exceptions', 'ImportError'))
809 self.assertEqual(mapping('exceptions', name),
810 ('exceptions', name))
811 else:
812 self.assertEqual(reverse_mapping('builtins', name),
813 ('exceptions', name))
814 self.assertEqual(mapping('exceptions', name),
815 ('builtins', name))
816
817 def test_multiprocessing_exceptions(self):
818 module = import_helper.import_module('multiprocessing.context')

Callers

nothing calls this directly

Calls 6

reverse_mappingFunction · 0.85
get_exceptionsFunction · 0.85
issubclassFunction · 0.85
subTestMethod · 0.80
mappingFunction · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected