tests: Simplify origin comparison and improve pytest diff on failure
By using a single equality instead of checking len() then zip() to check one by one, pytest can find the common/missing elements and print them nicely when the two lists are unequal.
This commit is contained in:
parent
4b511b4181
commit
b7ec6cb120
8 changed files with 53 additions and 94 deletions
|
@ -97,13 +97,7 @@ def check_listed_origins(lister_urls: List[str], scheduler_origins: List[ListedO
|
|||
|
||||
Does not test last_update."""
|
||||
|
||||
sorted_lister_urls = list(sorted(lister_urls))
|
||||
sorted_scheduler_origins = list(sorted(scheduler_origins))
|
||||
|
||||
assert len(sorted_lister_urls) == len(sorted_scheduler_origins)
|
||||
|
||||
for l_url, s_origin in zip(sorted_lister_urls, sorted_scheduler_origins):
|
||||
assert l_url == s_origin.url
|
||||
assert set(lister_urls) == {origin.url for origin in scheduler_origins}
|
||||
|
||||
|
||||
def test_tuleap_full_listing(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue