Skip to content

Navigation Menu

Sign in
Sign up

Extract four more test clusters out of pycc_types tests.rs (part of #695) - #996

Open
rotnov wants to merge 9 commits into
main from
autopilot/iter-2026年09月07日-32
Open

Extract four more test clusters out of pycc_types tests.rs (part of #695) #996
rotnov wants to merge 9 commits into
main from
autopilot/iter-2026年09月07日-32

Conversation

@rotnov

@rotnov rotnov commented Sep 7, 2026

Copy link
Copy Markdown
Owner

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.rs is under the ~1,000-line threshold.

What changed

Four cohesion-driven test clusters move verbatim out of
crates/pycc_types/src/tests.rs into new sibling child modules under
crates/pycc_types/src/tests/, following the sibling-tests.rs-plus-tests/
layout (no mod.rs) that #995 established with tests/constraints.rs. Each new
file reproduces that file's header and use super::*; convention.

new file lines #[test] cluster
crates/pycc_types/src/tests/typing_cast.rs 674 39 #767 typing.cast(T, value) as a special-cased builtin call
crates/pycc_types/src/tests/pattern_matching.rs 559 43 #381 match statement type checking
crates/pycc_types/src/tests/exception_handling.rs 420 31 #382 exception handling
crates/pycc_types/src/tests/optional_narrowing.rs 559 36 #769 flow-sensitive Optional[T] narrowing

crates/pycc_types/src/tests.rs goes 26,906 → 24,744 lines, and its own
#[test] count 1,192 → 1,043. The child-module declaration block gains the four
new 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 #382 run opens with four non-test helpers — parse_check_resolve,
parse_check, expect_top_level_try, expect_top_level_raise. About forty
tests that remain in tests.rs call parse_check_resolve/parse_check, and a
parent module cannot see a child module's private items, so moving them would
not compile. They stay in tests.rs under a reworded banner pointing at the new
child module; only the tests below them moved.
expect_top_level_try/expect_top_level_raise are now used only from the
child, which is still a real use for dead-code analysis — the clean
clippy -D warnings run 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; no
moved 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 across tests.rs plus every file in tests/ is 1,337
both before and after
, and cargo test -p pycc_types reports 1,625 passing
tests both before and after
.

Gates, each run so its exit status survived:

gate exit
cargo fmt --check 0
cargo build --workspace 0
cargo test -p pycc_types 0 (1,625 passed)
cargo clippy --workspace --all-targets -- -D warnings 0
cargo llvm-cov --workspace --fail-under-lines 100 --fail-under-regions 100 0 (100.00% lines and regions)

The 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

chatgpt-codex-connector Bot commented Sep 7, 2026
edited
Loading

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年09月07日T20:37:09.057878Z 8dbe6ee New commits
🔒 Security Review Completed 2026年09月07日T19:07:25.081382Z 0c9a489 PR opened
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" 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.

#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>
rotnov force-pushed the autopilot/iter-2026年09月07日-32 branch from 0c9a489 to d4c396a Compare September 7, 2026 19:03

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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".

Comment thread crates/pycc_types/src/tests/typing_cast.rs Outdated
...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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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".

Comment thread crates/pycc_types/src/tests/exception_handling.rs Outdated
rotnov and others added 2 commits September 7, 2026 20:18
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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".

Comment thread crates/pycc_types/src/tests/typing_cast.rs
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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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".

Comment thread crates/pycc_types/src/tests/exception_handling.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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".

Comment thread docs/sessions/2026-09-07-06-issue-695-tests-six-cluster-extraction.md Outdated
...he snapshot
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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".

Comment thread docs/sessions/2026-09-07-06-issue-695-tests-six-cluster-extraction.md Outdated
...ot drift
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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".

Comment thread crates/pycc_types/src/tests/exception_handling.rs Outdated
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /