Skip to content

Commit 5e8c9fd

Browse files
committed
Avoid invoking the find binary in unit test
Just use Path().rglob() instead.
1 parent dc2953d commit 5e8c9fd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/test_async_delete.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import subprocess
21
import tempfile
32
import time
43
import unittest
@@ -121,8 +120,8 @@ def _dump_dir_tree(directory: Path, message: str):
121120
print("State for test", message)
122121
if not directory.exists():
123122
print("(nonexistant)", directory)
124-
files = subprocess.check_output(["find", str(directory)]).rstrip().decode("utf-8").split("\n")
125-
print(" ", "\n ".join(files))
123+
for f in directory.rglob("*"):
124+
print(" ", f.relative_to(directory))
126125

127126
def _check_async_delete(self, message, tmpdir_expected: bool):
128127
self._dump_dir_tree(self.config.source_root / "build", message)

0 commit comments

Comments
 (0)