Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Lib/test/test_json/test_decode.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import decimal
import unittest.mock
from io import StringIO
from collections import OrderedDict
from test.test_json import PyTest, CTest
Expand Down Expand Up @@ -155,6 +156,15 @@ def test_limit_int(self):
with self.assertRaises(ValueError):
self.loads('1' * (maxdigits + 1))

def test_explicit_cls_skips_json_decoder_default(self):
class CustomDecoder:
pass

with unittest.mock.patch.object(
CustomDecoder, 'decode', create=True) as mock_decode:
self.loads('{}', cls=CustomDecoder)
mock_decode.assert_called_once()


class TestPyDecode(TestDecode, PyTest): pass
class TestCDecode(TestDecode, CTest): pass
Loading