From f85311727d53bc48ab0327ce0123bdcfb40a4296 Mon Sep 17 00:00:00 2001 From: Yusuke Kadowaki Date: Thu, 3 Nov 2022 20:56:26 +0900 Subject: [PATCH] Add comments on why ignoring symlinks in some tests --- testing/test_tmpdir.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py index 6cac04717..e681470a4 100644 --- a/testing/test_tmpdir.py +++ b/testing/test_tmpdir.py @@ -132,6 +132,9 @@ class TestConfigTmpPath: pytester.inline_run(p) root = pytester._test_tmproot 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()) # Check the base dir itself is gone assert len(list(base_dir)) == 0