mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
gh-99925: Fix inconsistency in json.dumps()
error messages (GH-99926)
This commit is contained in:
parent
a6331b605e
commit
d98ca8172c
3 changed files with 9 additions and 3 deletions
|
@ -26,7 +26,8 @@ class TestFloat:
|
|||
res = self.loads(out)
|
||||
self.assertEqual(len(res), 1)
|
||||
self.assertNotEqual(res[0], res[0])
|
||||
self.assertRaises(ValueError, self.dumps, [val], allow_nan=False)
|
||||
msg = f'Out of range float values are not JSON compliant: {val}'
|
||||
self.assertRaisesRegex(ValueError, msg, self.dumps, [val], allow_nan=False)
|
||||
|
||||
|
||||
class TestPyFloat(TestFloat, PyTest): pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue