aboutsummaryrefslogtreecommitdiff
path: root/tests/extmod/ujson_dumps.py
AgeCommit message (Collapse)Author
2020-03-30tests: Format all Python code with black, except tests in basics subdir.David Lechner
This adds the Python files in the tests/ directory to be formatted with ./tools/codeformat.py. The basics/ subdirectory is excluded for now so we aren't changing too much at once. In a few places `# fmt: off`/`# fmt: on` was used where the code had special formatting for readability or where the test was actually testing the specific formatting.
2019-07-30py/objdict: Quote non-string types when used as keys in JSON output.Eric Poulsen
JSON requires that keys of objects be strings. CPython will therefore automatically quote simple types (NoneType, bool, int, float) when they are used directly as keys in JSON output. To prevent subtle bugs and emit compliant JSON, MicroPython should at least test for such keys so they aren't silently let through. Then doing the actual quoting is a similar cost to raising an exception, so that's what is implemented by this patch. Fixes issue #4790.
2017-06-10tests: Convert remaining "sys.exit()" to "raise SystemExit".Paul Sokolovsky
2017-02-15tests/extmod: Make tests skippable.Paul Sokolovsky
2015-06-25tests: Split out json float tests to separate files.Damien George
2015-03-14tests: Add some more tests for bytes, bignum, string and ujson.Damien George
2014-09-25py: Simplify JSON str printing (while still conforming to JSON spec).Damien George
The JSON specs are relatively flexible and allow us to use one function to print strings, be they ascii, bytes or utf-8 encoded.
2014-09-17py: Add native json printing using existing print framework.Damien George
Also add start of ujson module with dumps implemented. Enabled in unix and stmhal ports. Test passes on both.