From 3844733d604d83fbfec5592cee20aab065ebff48 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 2 Nov 2024 13:43:35 -0500 Subject: [PATCH] tests/cpydiff: Fix test case for modules_json_nonserializable. The test case was producing the following error: Traceback (most recent call last): File "", line 12, in UnicodeError: which did not demonstrate the intended difference (this particular non-json-serializable object DID throw an exception! just not TypeError). The updated test uses a byte string with all ASCII bytes inside, which better illustrates the diference. Signed-off-by: Jeff Epler --- tests/cpydiff/modules_json_nonserializable.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/cpydiff/modules_json_nonserializable.py b/tests/cpydiff/modules_json_nonserializable.py index ffe523786f50..d6a5660cadfd 100644 --- a/tests/cpydiff/modules_json_nonserializable.py +++ b/tests/cpydiff/modules_json_nonserializable.py @@ -6,10 +6,7 @@ """ import json -a = bytes(x for x in range(256)) try: - z = json.dumps(a) - x = json.loads(z) - print("Should not get here") + print(json.dumps(b"shouldn't be able to serialise bytes")) except TypeError: print("TypeError")