Skip to content
Snippets Groups Projects
Commit 2eb88f5d authored by Damien George's avatar Damien George
Browse files

tests/extmod: Split json.loads of bytes/bytearray into separate test.

Because this functionality was introduced in Python 3.6.
parent 2dfa69ef
No related branches found
No related tags found
No related merge requests found
...@@ -37,10 +37,6 @@ my_print(json.loads('"abc\\uabcd"')) ...@@ -37,10 +37,6 @@ my_print(json.loads('"abc\\uabcd"'))
# whitespace handling # whitespace handling
my_print(json.loads('{\n\t"a":[]\r\n, "b":[1], "c":{"3":4} \n\r\t\r\r\r\n}')) my_print(json.loads('{\n\t"a":[]\r\n, "b":[1], "c":{"3":4} \n\r\t\r\r\r\n}'))
# loading from bytes and bytearray
my_print(json.loads(b'[1,2]'))
my_print(json.loads(bytearray(b'[null]')))
# loading nothing should raise exception # loading nothing should raise exception
try: try:
json.loads('') json.loads('')
......
# test loading from bytes and bytearray (introduced in Python 3.6)
try:
import ujson as json
except ImportError:
try:
import json
except ImportError:
print("SKIP")
raise SystemExit
print(json.loads(b'[1,2]'))
print(json.loads(bytearray(b'[null]')))
[1, 2]
[None]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment