https://github.com/python/cpython/commit/d9cfe7e565a6e2dc15747a904736264e31a10be4
commit: d9cfe7e565a6e2dc15747a904736264e31a10be4
branch: main
author: Nikita Sobolev <[email protected]>
committer: sobolevn <[email protected]>
date: 2024-03-29T14:14:25+03:00
summary:

gh-117166: Ignore empty and temporary dirs in `test_makefile` (#117190)

files:
M Lib/test/test_tools/test_makefile.py

diff --git a/Lib/test/test_tools/test_makefile.py 
b/Lib/test/test_tools/test_makefile.py
index 7222a054dcd61c..17a1a6d0d38d7d 100644
--- a/Lib/test/test_tools/test_makefile.py
+++ b/Lib/test/test_tools/test_makefile.py
@@ -41,9 +41,17 @@ def test_makefile_test_folders(self):
         self.assertIn(idle_test, test_dirs)
 
         used = [idle_test]
-        for dirpath, _, _ in os.walk(support.TEST_HOME_DIR):
+        for dirpath, dirs, files in os.walk(support.TEST_HOME_DIR):
             dirname = os.path.basename(dirpath)
-            if dirname == '__pycache__':
+            # Skip temporary dirs:
+            if dirname == '__pycache__' or dirname.startswith('.'):
+                dirs.clear()  # do not process subfolders
+                continue
+            # Skip empty dirs:
+            if not dirs and not files:
+                continue
+            # Skip dirs with hidden-only files:
+            if files and all(filename.startswith('.') for filename in files):
                 continue
 
             relpath = os.path.relpath(dirpath, support.STDLIB_DIR)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to