-
Notifications
You must be signed in to change notification settings - Fork 0
Extract four more test clusters out of pycc_types tests.rs (part of #695) - #996
Extract four more test clusters out of pycc_types tests.rs (part of #695) #996rotnov wants to merge 9 commits into
pycc_types tests.rs (part of #695) #996Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
i️ 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. |
#695) Relocate the `typing.cast` (#767), pattern-matching (#381), exception-handling (#382) and `Optional[T]`-narrowing (#769) test clusters verbatim into new sibling child modules under `crates/pycc_types/src/tests/`, following the layout PR #995 established with `tests/constraints.rs`. The parent file goes from 26,906 to 24,744 lines; the `#[test]` total across `tests.rs` and `tests/` is unchanged at 1,337, and `cargo test -p pycc_types` still reports 1,625 passing tests. The four `#382` helpers (`parse_check_resolve`, `parse_check`, `expect_top_level_try`, `expect_top_level_raise`) stay in `tests.rs`, because about forty tests that remain there call them and a parent module cannot see a child module's private items. Their banner is reworded to say where the tests themselves now live. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0c9a489 to
d4c396a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c9a489b80
i️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
...d module The two retained exception-handling helpers' doc comments name the tests that cover their panic arms. Those tests moved to the exception_handling child module in this same change, so the bare names no longer resolve locally in the file that carries the comment. Qualify both with the child module path. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12304fbb03
i️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad2d85a7e1
i️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Retarget the `expr.rs` cross-reference at the `typing.cast` gap note from `tests.rs` to `tests/typing_cast.rs`, where `cast_without_its_import_is_currently_accepted` now lives. Move `protocol_argument_mismatch_emits_t0046` and `check_skips_abstract_method_body_checking` verbatim back into `tests.rs`, appended to the `// -- direct unit tests for defense-in-depth paths` run: they came along with the `typing.cast` extraction for coverage reasons but test nothing about `typing.cast`. Extract the six #790 `typing.TYPE_CHECKING` marker tests out of `tests/typing_cast.rs` into `tests/type_checking_marker.rs`, and the five enum-loop unrolling tests out of `tests/exception_handling.rs` into `tests/enum_unrolling.rs`. Both clusters move verbatim; the parent's `#382` helper banner is reworded because `parse_check_resolve` now serves two child modules. A sorted line-multiset comparison of `tests.rs` plus `tests/*.rs` before and after differs only by the new module headers, the two new banners, the reworded one, the two `mod` declarations and the two `use super::*;` lines, and the `#[test]` total is unchanged at 1,337. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aecec65b02
i️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 57a93e8f53
i️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
...he snapshot Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c78c6939a
i️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
...ot drift Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8dbe6ee2b6
i️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Part of #695; #695 stays open. This pull request does not carry
Fixes #695—the D-185 tracker is narrowed by comment after each merge and closed only once
crates/pycc_types/src/tests.rsis under the ~1,000-line threshold.What changed
Four cohesion-driven test clusters move verbatim out of
crates/pycc_types/src/tests.rsinto new sibling child modules undercrates/pycc_types/src/tests/, following the sibling-tests.rs-plus-tests/layout (no
mod.rs) that #995 established withtests/constraints.rs. Each newfile reproduces that file's header and
use super::*;convention.#[test]crates/pycc_types/src/tests/typing_cast.rstyping.cast(T, value)as a special-cased builtin callcrates/pycc_types/src/tests/pattern_matching.rsmatchstatement type checkingcrates/pycc_types/src/tests/exception_handling.rscrates/pycc_types/src/tests/optional_narrowing.rsOptional[T]narrowingcrates/pycc_types/src/tests.rsgoes 26,906 → 24,744 lines, and its own#[test]count 1,192 → 1,043. The child-module declaration block gains the fournew modules, kept alphabetical, and the comment above it is updated so it still
describes which clusters actually live in child files. No production code and
no other file is touched.
One deviation from a pure verbatim cut
The
#382run opens with four non-test helpers —parse_check_resolve,parse_check,expect_top_level_try,expect_top_level_raise. About fortytests that remain in
tests.rscallparse_check_resolve/parse_check, and aparent module cannot see a child module's private items, so moving them would
not compile. They stay in
tests.rsunder a reworded banner pointing at the newchild module; only the tests below them moved.
expect_top_level_try/expect_top_level_raiseare now used only from thechild, which is still a real use for dead-code analysis — the clean
clippy -D warningsrun confirms it.Verification
Banner integrity was checked on every cut before and after removal: each range
starts at a real
// --banner preceded by a closing}and a blank line; nomoved span contains an interior banner (each contains exactly one, its own); and
the first surviving item below each seam still carries its own banner
(
// -- #380 W1: ...,// -- direct unit tests for defense-in-depth paths ...,// -- #382 coverage tests --,// -- #911 (Part 1 of #885): ...).The
#[test]total acrosstests.rsplus every file intests/is 1,337both before and after, and
cargo test -p pycc_typesreports 1,625 passingtests both before and after.
Gates, each run so its exit status survived:
cargo fmt --checkcargo build --workspacecargo test -p pycc_typescargo clippy --workspace --all-targets -- -D warningscargo llvm-cov --workspace --fail-under-lines 100 --fail-under-regions 100The D-014 coverage gate ran after the same preparatory builds CI performs
(
cargo build --target x86_64-apple-darwin -p pycc_rt,cargo build --workspace,cargo build --release -p pycc_rt).A D-066/D-130/D-192 session snapshot is included as
docs/sessions/2026-09-07-06-issue-695-tests-four-cluster-extraction.md.Session: claude-code 6aebf4b1-d3ba-4305-8415-acecf5d0151b