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

Method test_pickle

Lib/test/test_coroutines.py:2123–2136  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2121 aw.close()
2122
2123 def test_pickle(self):
2124 async def func(): pass
2125 coro = func()
2126 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
2127 with self.assertRaises((TypeError, pickle.PicklingError)):
2128 pickle.dumps(coro, proto)
2129
2130 aw = coro.__await__()
2131 try:
2132 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
2133 with self.assertRaises((TypeError, pickle.PicklingError)):
2134 pickle.dumps(aw, proto)
2135 finally:
2136 aw.close()
2137
2138 def test_fatal_coro_warning(self):
2139 # Issue 27811

Callers

nothing calls this directly

Calls 5

funcFunction · 0.70
assertRaisesMethod · 0.45
dumpsMethod · 0.45
__await__Method · 0.45
closeMethod · 0.45

Tested by

no test coverage detected