diff options
author | FrantiĊĦek Nesveda <fnesveda@users.noreply.github.com> | 2022-12-20 10:54:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-20 10:54:56 (GMT) |
commit | d98ca8172c39326bb200308a5191ceeb4a262d53 (patch) | |
tree | 0577a1fab0e3b12981cd70e22d3724199bea01dc /Lib/test | |
parent | a6331b605e8044a205a113e1db87d2b0a53d0222 (diff) | |
download | cpython-d98ca8172c39326bb200308a5191ceeb4a262d53.zip cpython-d98ca8172c39326bb200308a5191ceeb4a262d53.tar.gz cpython-d98ca8172c39326bb200308a5191ceeb4a262d53.tar.bz2 |
gh-99925: Fix inconsistency in `json.dumps()` error messages (GH-99926)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_json/test_float.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_json/test_float.py b/Lib/test/test_json/test_float.py index d0c7214..61540a3 100644 --- a/Lib/test/test_json/test_float.py +++ b/Lib/test/test_json/test_float.py @@ -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 |