Ignore .github dir in package test (#5098)

Added comments for ignore code
This commit is contained in:
JKLeckr
2025-07-27 19:57:19 -05:00
committed by GitHub
parent 04a3f78605
commit f8d1e4edf3

View File

@@ -8,7 +8,12 @@ class TestPackages(unittest.TestCase):
to indicate full package rather than namespace package."""
import Utils
# Ignore directories with these names.
ignore_dirs = {".github"}
worlds_path = Utils.local_path("worlds")
for dirpath, dirnames, filenames in os.walk(worlds_path):
# Drop ignored directories from dirnames, excluding them from walking.
dirnames[:] = [d for d in dirnames if d not in ignore_dirs]
with self.subTest(directory=dirpath):
self.assertEqual("__init__.py" in filenames, any(file.endswith(".py") for file in filenames))