runner.run(suite)
if __name__ == '__main__':
- import os
- import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
main()
class JSONTestObject:
pass
+
class RecursiveJSONEncoder(json.JSONEncoder):
recurse = False
def default(self, o):
return 'JSONTestObject'
return json.JSONEncoder.default(o)
+
class TestRecursion(TestCase):
def test_listrecursion(self):
x = []
}
$ echo '{ 1.2:3.4}' | python -mjson.tool
Expecting property name: line 1 column 2 (char 2)
+
"""
import sys
import json