(self)
| 1870 | f'when serializing {REX.__module__}.REX object']) |
| 1871 | |
| 1872 | def test_wrong_newobj_class(self): |
| 1873 | obj = REX((copyreg.__newobj__, (str,))) |
| 1874 | for proto in protocols[2:]: |
| 1875 | with self.subTest(proto=proto): |
| 1876 | with self.assertRaises(pickle.PicklingError) as cm: |
| 1877 | self.dumps(obj, proto) |
| 1878 | self.assertEqual(str(cm.exception), |
| 1879 | f'first argument to __newobj__() must be {REX!r}, not {str!r}') |
| 1880 | self.assertEqual(cm.exception.__notes__, [ |
| 1881 | f'when serializing {REX.__module__}.REX object']) |
| 1882 | |
| 1883 | def test_unpickleable_newobj_class(self): |
| 1884 | class LocalREX(REX): pass |
nothing calls this directly
no test coverage detected