8000 gh-99925: Fix inconsistency in `json.dumps()` error messages by fnesveda · Pull Request #99926 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-99925: Fix inconsistency in json.dumps() error messages #99926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 20, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Add unit test for error message
  • Loading branch information
fnesveda committed Dec 19, 2022
commit 3cba672b1f5bb94723c2dcd0cdba95e17be0933a
3 changes: 2 additions & 1 deletion Lib/test/test_json/test_float.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def test_allow_nan(self):
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
Expand Down
0