mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
bpo-45269: test wrong markers
type to c_make_encoder
(GH-28540)
This commit is contained in:
parent
4f05f15d7b
commit
e046aabbe3
2 changed files with 10 additions and 0 deletions
|
@ -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})
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Cover case when invalid ``markers`` type is supplied to ``c_make_encoder``.
|
Loading…
Add table
Add a link
Reference in a new issue