diff options
author | Jeff Epler <jepler@gmail.com> | 2024-11-02 13:43:35 -0500 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-11-11 12:35:03 +1100 |
commit | 3844733d604d83fbfec5592cee20aab065ebff48 (patch) | |
tree | c9a3f9420a37b89eb38daafec9e9670ae32cfe47 /tests/cpydiff/modules_json_nonserializable.py | |
parent | 5dfbd4371480c175e6f54e57e4e5eb5d579cbd00 (diff) | |
download | micropython-3844733d604d83fbfec5592cee20aab065ebff48.tar.gz micropython-3844733d604d83fbfec5592cee20aab065ebff48.zip |
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>
Diffstat (limited to 'tests/cpydiff/modules_json_nonserializable.py')
-rw-r--r-- | tests/cpydiff/modules_json_nonserializable.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/cpydiff/modules_json_nonserializable.py b/tests/cpydiff/modules_json_nonserializable.py index ffe523786f..d6a5660cad 100644 --- a/tests/cpydiff/modules_json_nonserializable.py +++ b/tests/cpydiff/modules_json_nonserializable.py @@ -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") |