(self)
| 42 | json.dumps(x) |
| 43 | |
| 44 | def test_dictrecursion(self): |
| 45 | x = {} |
| 46 | x["test"] = x |
| 47 | try: |
| 48 | json.dumps(x) |
| 49 | except ValueError: |
| 50 | pass |
| 51 | else: |
| 52 | self.fail("didn't raise ValueError on dict recursion") |
| 53 | x = {} |
| 54 | y = {"a": x, "b": x} |
| 55 | # ensure that the marker is cleared |
| 56 | json.dumps(y) |
| 57 | |
| 58 | def test_defaultrecursion(self): |
| 59 | enc = RecursiveJSONEncoder() |