Skip to content

Do not infer Python runners from stub-only tests - #53

Merged
hzw0813 merged 6 commits into
mainfrom
fix/python-stub-check-discovery
Aug 15, 2026
Merged

Do not infer Python runners from stub-only tests#53
hzw0813 merged 6 commits into
mainfrom
fix/python-stub-check-discovery

Conversation

@hzw0813

@hzw0813 hzw0813 commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • require an executable .py test file before layout-based Python framework discovery can infer pytest or unittest
  • keep .pyi files available to static Python analysis and test-like relationship discovery
  • add regressions proving stub-only repositories do not invent runtime checks while stub relationships remain visible and stop at runner qualification
  • document the static-vs-runnable distinction and regenerate committed dist

Why

detectPythonTests() accepted both .py and .pyi test-shaped filenames even though Python target qualification already rejects .pyi. That meant a repository containing only test-shaped type stubs could cause --run-checks to launch python -m pytest or python -m unittest despite having no executable Python test file. This crossed ProofDiff's own separation between broad test-like relationship discovery and runnable-target identity.

The fix narrows only framework discovery. Stub files remain valid source/static relationship inputs; they simply cannot create an executable runner by themselves.

Verification

  • full npm test passed after the change
  • clean npm run build regenerated dist
  • dedicated regressions cover both pytest-like and unittest-like .pyi stubs and static relationship preservation
  • temporary updater files were removed from the final diff

@hzw0813
hzw0813 merged commit 15a4d9e into main Aug 15, 2026
13 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