MCPcopy Index your code
hub / github.com/python/cpython / test_pickle

Method test_pickle

Lib/test/test_codecs.py:3710–3719  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3708 copy.deepcopy(sr)
3709
3710 def test_pickle(self):
3711 q = Queue(b'')
3712 codec = codecs.lookup('ascii')
3713 sr = codecs.StreamRecoder(q, codec.encode, codec.decode,
3714 encodings.ascii.StreamReader, encodings.ascii.StreamWriter)
3715
3716 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
3717 with self.subTest(protocol=proto):
3718 with self.assertRaisesRegex(TypeError, 'StreamRecoder'):
3719 pickle.dumps(sr, proto)
3720
3721
3722@unittest.skipIf(_testinternalcapi is None, 'need _testinternalcapi module')

Callers

nothing calls this directly

Calls 5

assertRaisesRegexMethod · 0.80
QueueClass · 0.70
lookupMethod · 0.45
subTestMethod · 0.45
dumpsMethod · 0.45

Tested by

no test coverage detected