-
Notifications
You must be signed in to change notification settings - Fork 991
Tests: Ignore .github directories in package test #5098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
1117721
to
66ca041
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable
b34d012
to
f638053
Compare
worlds_path = Utils.local_path("worlds") | ||
for dirpath, dirnames, filenames in os.walk(worlds_path): | ||
dirnames[:] = [d for d in dirnames if d not in ignore_dirs] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could probably use a comment as it's not obvious that it's modifying the list used in the walk generator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Y'know. Ironically, I was taking a lot of time contemplating whether the comments were necessary or not since I did not see much existing comments in this code.
I added comments.
Added comments for ignore code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks fine, lightly tested with different folder structures + invalid tests to see errors when it was included and it filtered as expected
What is this fixing or adding?
What is this?
The package test now ignores .github directories (can be changed to exclude more or less directories).
Why is it needed?
There are some APWorlds that use python scripts for GitHub Actions (contained in .github), but then doing so would fail the unit tests.
There is always adding an
__init__.py
in there, but then python would treat the .github directory as a module, which isn't always the desired behavior.How was this tested?
Ran the Unit Tests with and without python scripts in the .github directories, and tested to see if it still caught .py scripts without
__init__.py
in other directories.