Skip to content

Commit 50785d3

Browse files
committed
Fix unit test
1 parent 9fb0521 commit 50785d3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test_load_archive.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import operator
12
import shutil
23

34
import pytest
@@ -31,8 +32,10 @@ def test_load_archive(pattern, match_members, tmp_dir, archive_format, file_exte
3132
archivepath = str(root_dir / "myarchive")
3233
archivepath = shutil.make_archive(archivepath, archive_format, root_dir=root_dir, base_dir=".")
3334

34-
expected = [(name, tests.data) for name in match_members]
35-
result = [(name, list(data)) for name, data in jsonl.load_archive(archivepath, pattern=pattern)]
35+
order_by = operator.itemgetter(0)
36+
expected = sorted(((name, tests.data) for name in match_members), key=order_by)
37+
result = jsonl.load_archive(archivepath, pattern=pattern)
38+
result = sorted(((name, list(data)) for name, data in result), key=order_by)
3639
assert result == expected
3740

3841

0 commit comments

Comments
 (0)