Skip to content

Commit 3c65e21

Browse files
committed
-
1 parent 3facb0c commit 3c65e21

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

source_py2/test_python_toolbox/test_zip_tools/test_zip_folder.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,23 @@ def test():
2424
(folder_to_zip / 'some_other_file.txt').open('w').write(
2525
u'hello there again!')
2626

27+
import gc; gc.collect()
28+
2729
zip_file_path = temp_folder / 'archive.zip'
2830
assert isinstance(zip_file_path, pathlib.Path)
2931
zip_tools.zip_folder(folder_to_zip, temp_folder / 'archive.zip')
3032

31-
assert zip_file_path.is_file()
32-
assert set(
33+
result = set(
3334
zip_tools.unzip_in_memory(zip_file_path.open('rb').read())
34-
) == {
35+
)
36+
37+
assert zip_file_path.is_file()
38+
39+
# Got two options here because of PyPy shenanigans:
40+
assert result == {
3541
('folder_to_zip/some_file.txt', b'hello there!'),
3642
('folder_to_zip/some_other_file.txt', b'hello there again!'),
43+
} or result == {
44+
('folder_to_zip/some_file.txt', 'hello there!'),
45+
('folder_to_zip/some_other_file.txt', 'hello there again!'),
3746
}

0 commit comments

Comments
 (0)