Skip to content

Commit

Permalink
Make tests deterministic
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Aug 20, 2024
1 parent ab569f8 commit 9f5464b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion boa_zksync/compiler_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def get_compiler_output(output):
contract_keys = set(output.keys()) - excluded_keys

if len(contract_keys) != 1:
raise ValueError(f"Expected exactly one contract key, found {contract_keys}")
unexpected = ", ".join(sorted(contract_keys))
raise ValueError(f"Expected exactly one contract key, found {unexpected}")

return output[next(iter(contract_keys))]
4 changes: 2 additions & 2 deletions tests/test_get_compiler_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_get_compiler_output_too_many_keys():

with pytest.raises(
ValueError,
match="Expected exactly one contract key, found {'blabla', 'new_compiler_output_key'}",
match="Expected exactly one contract key, found blabla, new_compiler_output_key",
):
get_compiler_output(output_dict)

Expand All @@ -32,6 +32,6 @@ def test_get_compiler_output_unexpected_key():

with pytest.raises(
ValueError,
match="Expected exactly one contract key, found {'blabla', 'zk_versions'}",
match="Expected exactly one contract key, found blabla, zk_versions",
):
get_compiler_output(output_dict)

0 comments on commit 9f5464b

Please sign in to comment.