Repository navigation
fix(python): pytest.ini wins even when empty, and read .pytest.ini - #314
Merged
adityankale190895 merged 1 commit intoNov 18, 2026
Merged
Conversation
pytest.ini and .pytest.ini match even without a [pytest] section, and then pytest uses its defaults; only pyproject.toml, tox.ini and setup.cfg need their section. readPytestSettings skipped a section-less pytest.ini and never read .pytest.ini. Closes DiffCI#159. Signed-off-by: sarankumar1325 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 18, 2026
adityankale190895
added a commit
that referenced
this pull request
Nov 18, 2026
Credit the pytest configuration fixes (#314, #315, #316) under the Python fallback reasons, and the pytest declared-inputs example (#319) next to the example. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: adityankale190895 <[email protected]>
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.
Closes #159
pytest's rule is that
pytest.ini"will always match and take precedence … even if empty", and the hidden.pytest.inibehaves the same way. Onlypyproject.toml,tox.iniandsetup.cfgneed their section to match.readPytestSettingsskipped any file without its section and never read.pytest.ini.Changes:
pytest.ini,.pytest.ini,pyproject.toml,tox.ini,setup.cfg.pytest.inior.pytest.iniexists, the search stops there, with or without a[pytest]section. pytest's defaults (test_*.py,*_test.py) apply when there is no section..pytest.iniis inPROJECT_FILES, so a repository whose only pytest file is.pytest.iniis detected as a Python project. The docs list that names the project files includes it too.CONFIG_PATTERNSentry is now^\.?pytest\.ini$, so a change to.pytest.inifalls back with the same named reason aspytest.ini.Tests in
tests/repo/python-adapter.test.ts, covering both cases from the issue plus:pytest.iniplus apyproject.tomlthat setscheck_*.pygives the defaults, sotest_x.pyis a test andcheck_x.pyis not;pytest.inistops the search beforetox.ini;.pytest.inithat setspython_files = check_*.pyis read;pytest.inibeats.pytest.ini, and an empty.pytest.inibeatspyproject.toml;.pytest.iniis detected.Mutation check: with the
src/changes reverted, 4 of the new cases fail.npm test(1243 pass, 0 fail),npm run typecheckandnpm run audit:boundarypass. DCO signed off.