diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-05-22 11:55:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-22 11:55:07 (GMT) |
commit | ae00fb1d4f38ea1803b10d798564740adcdad63e (patch) | |
tree | 9770377ec2e9fe879d44d87d908e8e0629aa1bfb /Lib/test/test_json | |
parent | 55bfe690d570958a66ee6c7b15fc8daca0f9c2d3 (diff) | |
download | cpython-ae00fb1d4f38ea1803b10d798564740adcdad63e.zip cpython-ae00fb1d4f38ea1803b10d798564740adcdad63e.tar.gz cpython-ae00fb1d4f38ea1803b10d798564740adcdad63e.tar.bz2 |
bpo-30877: Fix clearing a cache in the the JSON decoder. (GH-7048)
Diffstat (limited to 'Lib/test/test_json')
-rw-r--r-- | Lib/test/test_json/test_decode.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_json/test_decode.py b/Lib/test/test_json/test_decode.py index d84ef7d..fdb9e62 100644 --- a/Lib/test/test_json/test_decode.py +++ b/Lib/test/test_json/test_decode.py @@ -58,7 +58,9 @@ class TestDecode: def test_keys_reuse(self): s = '[{"a_key": 1, "b_\xe9": 2}, {"a_key": 3, "b_\xe9": 4}]' self.check_keys_reuse(s, self.loads) - self.check_keys_reuse(s, self.json.decoder.JSONDecoder().decode) + decoder = self.json.decoder.JSONDecoder() + self.check_keys_reuse(s, decoder.decode) + self.assertFalse(decoder.memo) def test_extra_data(self): s = '[1, 2, 3]5' |