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

Method test_pickle

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

Source from the content-addressed store, hash-verified

2134 aw.close()
2135
2136 def test_pickle(self):
2137 async def func(): pass
2138 coro = func()
2139 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
2140 with self.assertRaises((TypeError, pickle.PicklingError)):
2141 pickle.dumps(coro, proto)
2142
2143 aw = coro.__await__()
2144 try:
2145 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
2146 with self.assertRaises((TypeError, pickle.PicklingError)):
2147 pickle.dumps(aw, proto)
2148 finally:
2149 aw.close()
2150
2151 @unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'NoneType' object has no attribute 'err_msg'
2152 def test_fatal_coro_warning(self):

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