summaryrefslogtreecommitdiff
path: root/tests/cachekey
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-20 14:12:06 +0000
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-21 16:40:43 +0000
commit9f6e8f9a933c4af6f250b54da014922dbe8d4584 (patch)
tree7da4fe157226a22714db4e6d90054ac5ace550df /tests/cachekey
parentaa326c937b0146269be78ff03a554d6c1d7826cb (diff)
downloadbuildstream-9f6e8f9a933c4af6f250b54da014922dbe8d4584.tar.gz
tests: when comparing lists/dicts, compare all at once
This allows pytest to show a better report of the difference between the two lists and not just tell that one entry is wrong.
Diffstat (limited to 'tests/cachekey')
-rw-r--r--tests/cachekey/cachekey.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py
index bfeb89a8b..3fc5d73ee 100644
--- a/tests/cachekey/cachekey.py
+++ b/tests/cachekey/cachekey.py
@@ -255,6 +255,7 @@ def test_keys_stable_over_targets(cli, datafiles):
ordering2_result.assert_success()
ordering2_cache_keys = parse_output_keys(ordering2_result.output)
- for element in ordering1_cache_keys:
- assert ordering1_cache_keys[element] == ordering2_cache_keys[element]
- assert ordering1_cache_keys[element] == all_cache_keys[element]
+ elements = ordering1_cache_keys.keys()
+
+ assert {key: ordering2_cache_keys[key] for key in elements} == ordering1_cache_keys
+ assert {key: all_cache_keys[key] for key in elements} == ordering1_cache_keys