Add comments on why ignoring symlinks in some tests

This commit is contained in:
Yusuke Kadowaki 2022-11-03 20:56:26 +09:00
parent b04bbb1dcb
commit f85311727d
1 changed files with 3 additions and 0 deletions

View File

@ -132,6 +132,9 @@ class TestConfigTmpPath:
pytester.inline_run(p) pytester.inline_run(p)
root = pytester._test_tmproot root = pytester._test_tmproot
for child in root.iterdir(): for child in root.iterdir():
# This symlink will be deleted by cleanup_numbered_dir **after**
# the test finishes because it's triggered by atexit.
# So it has to be ignored here.
base_dir = filter(lambda x: not x.is_symlink(), child.iterdir()) base_dir = filter(lambda x: not x.is_symlink(), child.iterdir())
# Check the base dir itself is gone # Check the base dir itself is gone
assert len(list(base_dir)) == 0 assert len(list(base_dir)) == 0