mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Generate the JSON library and selected tests with update_lib from CPython d220409a13b77de7a6c30abe16ea90db01528edc, preserving native bootstrap workarounds and test markers. Exclude generated cache directories at the library copy boundary. Assisted-by: OpenAI Codex:model version unavailable
15 lines
417 B
Python
Vendored
15 lines
417 B
Python
Vendored
import json
|
|
import pickle
|
|
import unittest
|
|
|
|
class TestPickleable(unittest.TestCase):
|
|
def test_json_decode_error_is_pickleable(self):
|
|
e = json.JSONDecodeError(msg="abc", doc="def", pos=7)
|
|
|
|
pickled = pickle.dumps(e)
|
|
unpickled = pickle.loads(pickled)
|
|
|
|
self.assertEqual(unpickled.msg, e.msg)
|
|
self.assertEqual(unpickled.doc, e.doc)
|
|
self.assertEqual(unpickled.pos, e.pos)
|