Skip to content

test(python): show that declared inputs select pytest tests, and document it - #319

Merged
adityankale190895 merged 1 commit into
DiffCI:mainfrom
sarankumar1325:pytest-declared-inputs
Nov 18, 2026
Merged

adityankale190895 merged 1 commit into
DiffCI:mainfrom
sarankumar1325:pytest-declared-inputs

Conversation

@sarankumar1325

Copy link
Copy Markdown
Contributor

Fixes #162

Changed behavior

None in code: the new test shows that declared inputs already work for pytest.

  • tests/repo/python-declared-inputs.test.ts is new. It builds a synthetic pytest repository: tests/data/prices.csv, tests/test_prices.py that opens it by name, an unrelated tests/test_pricing.py, and a diffci.json entry { "files": ["tests/data/**"], "tests": ["tests/test_prices.py"] }. The test runs the real graph build (Python import analysis included) and the impact analyzer:
    • With the entry, changing the CSV selects only tests/test_prices.py, with reason DECLARED_INPUT. There is no fallback, and the planned command is python -m pytest tests/test_prices.py.
    • Without the entry, the same change runs the full suite (Unknown changed file: tests/data/prices.csv). That is the case the declaration exists for.
    • Like the other end-to-end Python tests, it is skipped when no Python 3 interpreter is on PATH.
  • docs/using-diffci.md, "Declare inputs the graph can't see": adds a short pytest example next to the JavaScript ones.

Validation

…ment it

A pytest fixture with a data file read by name and an inputs entry
mapping it to its test: changing the file selects that test with reason
DECLARED_INPUT, and without the entry it runs the full suite. The
"Declare inputs the graph can't see" section gains a pytest example.

Fixes DiffCI#162

Signed-off-by: sarankumar1325 <120080287+sarankumar1325@users.noreply.github.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T07:09:04.095979Z c93b8fd PR opened
ℹ️ 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.

@adityankale190895
adityankale190895 merged commit e41c538 into DiffCI:main Nov 18, 2026
13 checks passed
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 <noreply@anthropic.com>
Signed-off-by: adityankale190895 <adityankale1995@gmail.com>
@adityankale190895

Copy link
Copy Markdown
Member

Thank you, @sarankumar1325! Four pytest PRs landed today:

#315 and #316 conflicted with #314 only in the test file, so I resolved that on main. #319 also settled a question: its claim that declared inputs already worked for pytest was right. #272 had made that work, and I closed #320 as covered.

It's all credited in the README, on diffci.com/contributors, and in docs/using-diffci.md, next to the Python fallback reasons and the pytest example. It will also be in the next release notes.

#317 and #318 are close: once the fail-closed cases from the reviews are in, they're ready to merge.

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.

Show that declared inputs work for pytest, and document it

2 participants