diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-09-28 14:56:52 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-28 23:56:52 +0200 |
| commit | 1cb17be3e6a4d94629606a613acd07f78d50348b (patch) | |
| tree | bb2180a50d6042f9bd32e013cad97bed406694ef /Lib/test | |
| parent | ec4e2ec241acb3bf4e04a351c06c0b05a1e4b7d2 (diff) | |
| download | cpython-git-1cb17be3e6a4d94629606a613acd07f78d50348b.tar.gz | |
bpo-45269: test wrong `markers` type to `c_make_encoder` (GH-28540) (GH-28609)
(cherry picked from commit e046aabbe386fdf32bae6ffb7fae5ce479fd10c6)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Diffstat (limited to 'Lib/test')
| -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 fbfee1a582..682014cfd5 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}) |
