Skip to content

Scope the AGENTS.md test-file allowlist to Lib/test - #9519

Merged
youknowone merged 1 commit into
RustPython:mainfrom
jseop-lim:docs/agents-test-rules-scope
Nov 1, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
jseop-lim:docs/agents-test-rules-scope

Conversation

@jseop-lim

@jseop-lim jseop-lim commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

AGENTS.md gives two rules about test files that contradict each other for extra_tests/snippets. The Testing section asks for new tests in "the most closely related existing file in extra_tests/snippets", while Test Code Modification Rules says "the only acceptable modifications to test files" are adding or removing @unittest.expectedFailure markers. Read literally, the second forbids what the first asks for.

Reviewers that read AGENTS.md follow the second rule. Codex flagged the snippet additions in #9515, #9516 and #9517 as violations of it, each citing AGENTS.md L280-L282, and asked to drop the tests and keep only the Rust fix.

The allowlist came in with #5840 next to Lib/test/test_typing.py changes, and both of its items are unittest markers, so it is about the CPython tests in Lib/test.

Changes

  • Limit the allowlist to the CPython test files in Lib/test.
  • Say that adding a new test to an existing snippet file is allowed, pointing to the Testing section.
  • The rules against commenting out, deleting or changing existing tests are unchanged and still apply to every test file.

I used Claude Code (claude-opus-5-5) to draft the change and this description; I reviewed both myself.

Summary by CodeRabbit

  • Documentation
    • Clarified that the listed test-file changes apply specifically to CPython tests in Lib/test.
    • Explicitly allowed adding tests to existing extra_tests/snippets files and linked to the Testing section.

Test Code Modification Rules says the only acceptable modifications to
"test files" are adding or removing expectedFailure markers. Read
literally, that forbids adding a test to an existing
extra_tests/snippets file, which the Testing section asks for. Limit
that allowlist to the CPython tests in Lib/test and say snippet
additions are allowed. The rules against weakening existing tests
still apply everywhere.

Assisted-by: Claude Code:claude-opus-5-5
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 88f3733 and 04bad32.

Files selected for processing: 1
  • AGENTS.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Walkthrough

AGENTS.md now limits the listed decorator changes to CPython test files in Lib/test. It also allows adding tests to existing files in extra_tests/snippets.

Changes: Test-file guidance

Layer / File(s) Summary
Clarify test-file change rules
AGENTS.md
The rules scope two decorator changes to CPython test files in Lib/test and allow adding tests to existing extra_tests/snippets files.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Possibly related PRs

Suggested reviewers: youknowone

Merge Risk: Minimal · up to 04bad

The guidance clarifies permitted test additions and decorator changes while retaining restrictions against weakening existing tests. No merge-blocking risk is identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Scope the AGENTS.md test-file allowlist to Lib/test" names the main change. The PR limits the expected-failure-marker allowlist to CPython test files in Lib/test, which the title states. Th…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Scope the AGENTS.md test-file allowlist to Lib/test" names the main change. The PR limits the expected-failure-marker allowlist to CPython test files in Lib/test, which the title states. The title omits the second change, which clarifies that snippet additions to existing extra_tests/snippets files are allowed. That omission is acceptable because the title does not need to cover every detail. The title is specific and uses no vague terms.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@jseop-lim
jseop-lim marked this pull request as ready for review November 1, 2026 05:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 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-11-01T05:37:52.273811Z 04bad32 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.

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for catching this! 👍

@youknowone
youknowone merged commit 95cde75 into RustPython:main Nov 1, 2026
20 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.

2 participants