Skip to content

Commit 3844733

Browse files
jeplerdpgeorge
authored andcommitted
tests/cpydiff: Fix test case for modules_json_nonserializable.
The test case was producing the following error: Traceback (most recent call last): File "<stdin>", line 12, in <module> 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 <[email protected]>
1 parent 5dfbd43 commit 3844733

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tests/cpydiff/modules_json_nonserializable.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
"""
77
import json
88

9-
a = bytes(x for x in range(256))
109
try:
11-
z = json.dumps(a)
12-
x = json.loads(z)
13-
print("Should not get here")
10+
print(json.dumps(b"shouldn't be able to serialise bytes"))
1411
except TypeError:
1512
print("TypeError")

0 commit comments

Comments
 (0)