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 <jepler@gmail.com>
This commit is contained in:
parent
5dfbd43714
commit
3844733d60
1 changed files with 1 additions and 4 deletions
|
|
@ -6,10 +6,7 @@ workaround: Unknown
|
|||
"""
|
||||
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")
|
||||
|
|
|
|||
Loading…
Reference in a new issue