fix(tests): exclude root-level scripts from pytest collection (#11)#36
Open
bradsmithmba wants to merge 1 commit into
Open
fix(tests): exclude root-level scripts from pytest collection (#11)#36bradsmithmba wants to merge 1 commit into
bradsmithmba wants to merge 1 commit into
Conversation
Four root-level files — test_api.py, test_e2e.py, test_installed_api.py, test_options_simple.py — are standalone manual/integration scripts, not pytest test modules. test_api.py and test_installed_api.py call sys.exit() at module scope, so pytest importing them during auto-discovery raised SystemExit and aborted collection of the entire suite (INTERNALERROR). Add collect_ignore for the four files in the root conftest.py. They stay in place for manual use (`python test_api.py`) but are no longer auto-collected. Before: `pytest test_api.py --collect-only` -> INTERNALERROR: SystemExit. After: bare discovery collects 0 of the four scripts and does not abort. Note: a full `pytest` run still hits unrelated collection errors from the data layer (cloudtrainerwork#1), the CLI sys.exit (cloudtrainerwork#6), and the missing integrated_selector (cloudtrainerwork#21); those are tracked separately. This change removes the root-script class of collection-killer. Closes cloudtrainerwork#11 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four root-level files are standalone manual/integration scripts, not pytest test modules:
test_api.py(line 48) andtest_installed_api.py(lines 67/70) callsys.exit()at module scope. When pytest auto-discovers and imports them during collection,sys.exitraisesSystemExit, which aborts collection of the entire suite withINTERNALERROR.Closes #11.
Fix
Add
collect_ignorefor the four files in the rootconftest.py. They remain in place for manual use (python test_api.py) but are no longer auto-collected.Verification
Scope note
A full
pytestrun still surfaces unrelated collection errors from separately-tracked issues — the missing data layer (#1), the CLIsys.exitat import (#6), and the missingintegrated_selectormodule (#21). This PR removes the root-script class of collection-killer; it does not claim to make the whole suite collectable on its own. Those other PRs/issues handle the rest.🤖 Generated with Claude Code