-
Notifications
You must be signed in to change notification settings - Fork 48
feat: add test to ensure cogames tests do not import from metta #4422
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
feat: add test to ensure cogames tests do not import from metta #4422
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
| # Check all Python files in the cogames package | ||
| for py_file in iter_python_files(repo_root): | ||
| # Skip this test file itself | ||
| if py_file.name == "test_forbidden_imports.py": |
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.
you can maybe use __file__ or something
| continue | ||
| # Skip explicitly excluded files | ||
| rel_path = str(py_file.relative_to(repo_root)) | ||
| if rel_path in EXCLUDE_FILES: |
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 we should just remove EXCLUDE_FILES usage

What this PR does
We had test called
test_forbidden_imports()to prevent imports frommettaincogames.However, it only tested code in
cogames/src, meaningcogames/testscould still import frommetta, as was the case in #4421.Why this PR does that
It's important in publishing
cogamesas a stand-alone package that the tests run by themselves without reference to a private repository.Asana Task