Skip to content

Commit 4eb1b05

Browse files
committed
Fix tests on platforms that do not pre-sort their readdir results (e.g. Linux)
1 parent bb5e177 commit 4eb1b05

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_unasync.py

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
def list_files(startpath):
2020
output = ""
2121
for root, dirs, files in os.walk(startpath):
22+
# Ensure that we do not capture the directory inode order on
23+
# platforms that don't pre-sort `readdir` results
24+
dirs.sort()
25+
files.sort()
26+
2227
level = root.replace(startpath, "").count(os.sep)
2328
indent = " " * 4 * (level)
2429
output += "{}{}/".format(indent, os.path.basename(root))

0 commit comments

Comments
 (0)