def test_json_format(): demo = [{'foo': 'bar'}, {'bar': 'foo'}] sample = json.dumps(demo, indent=2, separators=(',', ': ')) assert sample == utils.jsonprint(demo), "Json formatting has changed"