diff --git a/swh/journal/pytest_plugin.py b/swh/journal/pytest_plugin.py --- a/swh/journal/pytest_plugin.py +++ b/swh/journal/pytest_plugin.py @@ -83,8 +83,9 @@ del value["ctime"] for key in known_keys: + str_key_error_msg = hash_to_hex(key) if not isinstance(key, dict) else key assert key in received_keys, ( - f"expected {object_type} key {hash_to_hex(key)} " + f"expected {object_type} key {str_key_error_msg} " "absent from consumed messages" )