diff --git a/tests/common.py b/tests/common.py index e1cb69b9..d6b4dd47 100644 --- a/tests/common.py +++ b/tests/common.py @@ -29,8 +29,10 @@ def normalize_json(src: typing.Union[str, dict]): "Normalize the shape of json to make comparing easier" if isinstance(src, dict): pass - if isinstance(src, str): + elif isinstance(src, str): src = json.loads(src) + elif isinstance(src, bytes): + src = json.loads(src.decode()) return json.dumps(src, sort_keys=True)