Skip to content

test: make local test helpers importable in subprocesses - #202

Merged
Birfy merged 2 commits into
mainfrom
fix/tests-package-shadow
Oct 10, 2026
Merged

Birfy merged 2 commits into
mainfrom
fix/tests-package-shadow

Conversation

@Birfy

@Birfy Birfy commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Reproduced problem

On unchanged main, tests/ was a namespace package. This host also has unrelated regular tests and scripts packages in Anaconda's Python 3.9 site-packages. The detached worker resolves tests.test_evolvespec:stub_reflect in a fresh process, where the installed tests package shadows the repository namespace.

The existing test_start_status_show_apply_flow then ended at round 0 with:

SpecError: reflect: 'tests.test_evolvespec:stub_reflect': cannot import
'tests.test_evolvespec' (No module named 'tests.test_evolvespec').

The repro used the local deterministic stub spec with OPENAI_API_KEY and OPENAI_BASE_URL unset; it made no model/API calls.

Fix

  • Make tests and scripts explicit packages so their local modules win over unrelated installed packages.
  • Add tests/ to pytest's configured import path to preserve existing top-level test helper imports.
  • Add a regression test that simulates conflicting installed tests and scripts packages.

This is separate from PR #201 and changes no runtime package behavior.

Verification

  • Reproduced on unchanged main tree cf19d2be37f2fd295efcb32e57a5d590b4b13961 (main 368f9a85d6da7f65d67ff82138c6348da8e78c8b).
  • After the fix: full pytest --collect-only -q succeeded locally; focused MCP, EvolveSpec, package-resolution and packaging tests: 56 passed, 2 skipped across the recorded runs, with provider credentials unset.
  • Exact-head CI passed at 7ab7cca35b64a04e259be823f3b1228831dafa35: tests, wheel build and wheel smoke on Python 3.9, 3.10, 3.11 and 3.12; strict docs build passed. Docs deploy skipped for the PR as expected.
  • The initial PR head exposed collection errors in legacy helper imports. The pytest path config and explicit scripts package address those; the corrected exact head is green.

Independent review is clean; the PR is Ready for review.

@Birfy
Birfy marked this pull request as ready for review October 9, 2026 23:46
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T23:48:50.426829Z 7ab7cca Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Birfy
Birfy merged commit 74c4600 into main Oct 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant