From 031edc401ebdbd064287c0d7d06acf6e3710a828 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Thu, 11 Jun 2026 11:50:46 -0500 Subject: [PATCH] fix(tests): exclude root-level scripts from pytest collection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (#1), the CLI sys.exit (#6), and the missing integrated_selector (#21); those are tracked separately. This change removes the root-script class of collection-killer. Closes #11 Co-Authored-By: Claude Opus 4.8 --- conftest.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/conftest.py b/conftest.py index 77f9fca..2ec6e2b 100644 --- a/conftest.py +++ b/conftest.py @@ -21,3 +21,14 @@ builtins.F = F builtins.np = np builtins.pd = pd + +# These root-level files are standalone manual/integration scripts, not pytest +# test modules. They execute code (and call sys.exit()) at import time, which +# aborts pytest collection for the entire suite. Exclude them from collection; +# run them directly (e.g. `python test_api.py`) when needed. (issue #11) +collect_ignore = [ + "test_api.py", + "test_e2e.py", + "test_installed_api.py", + "test_options_simple.py", +]