(self)
| 1858 | f'when serializing {REX.__module__}.REX object']) |
| 1859 | |
| 1860 | def test_bad_newobj_class(self): |
| 1861 | obj = REX((copyreg.__newobj__, (NoNew(),))) |
| 1862 | for proto in protocols[2:]: |
| 1863 | with self.subTest(proto=proto): |
| 1864 | with self.assertRaises(pickle.PicklingError) as cm: |
| 1865 | self.dumps(obj, proto) |
| 1866 | self.assertIn(str(cm.exception), { |
| 1867 | 'first argument to __newobj__() has no __new__', |
| 1868 | f'first argument to __newobj__() must be a class, not {NoNew.__module__}.NoNew'}) |
| 1869 | self.assertEqual(cm.exception.__notes__, [ |
| 1870 | f'when serializing {REX.__module__}.REX object']) |
| 1871 | |
| 1872 | def test_wrong_newobj_class(self): |
| 1873 | obj = REX((copyreg.__newobj__, (str,))) |
nothing calls this directly
no test coverage detected