From 2eb88f5df74263cf4b458b135d16a100eb7a8bd2 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 22 Aug 2019 15:45:13 +1000 Subject: tests/extmod: Split json.loads of bytes/bytearray into separate test. Because this functionality was introduced in Python 3.6. --- tests/extmod/ujson_loads_bytes.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/extmod/ujson_loads_bytes.py (limited to 'tests/extmod/ujson_loads_bytes.py') diff --git a/tests/extmod/ujson_loads_bytes.py b/tests/extmod/ujson_loads_bytes.py new file mode 100644 index 000000000..507e4ca88 --- /dev/null +++ b/tests/extmod/ujson_loads_bytes.py @@ -0,0 +1,13 @@ +# 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]'))) -- cgit v1.2.3