bpo-33461: emit DeprecationWarning when json.loads(encoding=...) is used (GH-6762)

This commit is contained in:
Matthias Bussonnier 2019-04-09 00:17:25 -07:00 committed by Inada Naoki
parent 5909ad1217
commit a8abe097c1
4 changed files with 22 additions and 4 deletions

View file

@ -95,5 +95,9 @@ class TestDecode:
d = self.json.JSONDecoder()
self.assertRaises(ValueError, d.raw_decode, 'a'*42, -50000)
def test_deprecated_encode(self):
with self.assertWarns(DeprecationWarning):
self.loads('{}', encoding='fake')
class TestPyDecode(TestDecode, PyTest): pass
class TestCDecode(TestDecode, CTest): pass