diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2021-09-28 21:18:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-28 21:18:00 (GMT) |
commit | e046aabbe386fdf32bae6ffb7fae5ce479fd10c6 (patch) | |
tree | 1273a4b8aaabf7a2032f54a985817589d4c9add5 /Lib/test/test_json/test_speedups.py | |
parent | 4f05f15d7b25ef8b690cb94fdc4c8cb5521a4e27 (diff) | |
download | cpython-e046aabbe386fdf32bae6ffb7fae5ce479fd10c6.zip cpython-e046aabbe386fdf32bae6ffb7fae5ce479fd10c6.tar.gz cpython-e046aabbe386fdf32bae6ffb7fae5ce479fd10c6.tar.bz2 |
bpo-45269: test wrong `markers` type to `c_make_encoder` (GH-28540)
Diffstat (limited to 'Lib/test/test_json/test_speedups.py')
-rw-r--r-- | Lib/test/test_json/test_speedups.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_json/test_speedups.py b/Lib/test/test_json/test_speedups.py index fbfee1a..682014c 100644 --- a/Lib/test/test_json/test_speedups.py +++ b/Lib/test/test_json/test_speedups.py @@ -59,6 +59,15 @@ class TestEncode(CTest): with self.assertRaises(ZeroDivisionError): enc('spam', 4) + def test_bad_markers_argument_to_encoder(self): + # https://bugs.python.org/issue45269 + with self.assertRaisesRegex( + TypeError, + r'make_encoder\(\) argument 1 must be dict or None, not int', + ): + self.json.encoder.c_make_encoder(1, None, None, None, ': ', ', ', + False, False, False) + def test_bad_bool_args(self): def test(name): self.json.encoder.JSONEncoder(**{name: BadBool()}).encode({'a': 1}) |