mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
gh-117166: Ignore empty and temporary dirs in test_makefile
(#117190)
This commit is contained in:
parent
35b6c4a4da
commit
d9cfe7e565
1 changed files with 10 additions and 2 deletions
|
@ -41,9 +41,17 @@ class TestMakefile(unittest.TestCase):
|
||||||
self.assertIn(idle_test, test_dirs)
|
self.assertIn(idle_test, test_dirs)
|
||||||
|
|
||||||
used = [idle_test]
|
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)
|
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
|
continue
|
||||||
|
|
||||||
relpath = os.path.relpath(dirpath, support.STDLIB_DIR)
|
relpath = os.path.relpath(dirpath, support.STDLIB_DIR)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue