Skip to content

Lift more native Python unittest assertions#1631

Merged
TSavo merged 1 commit into
mainfrom
codex/python-unittest-lifter-20260529
May 29, 2026
Merged

Lift more native Python unittest assertions#1631
TSavo merged 1 commit into
mainfrom
codex/python-unittest-lifter-20260529

Conversation

@TSavo
Copy link
Copy Markdown
Owner

@TSavo TSavo commented May 29, 2026

Summary

  • expand the existing Python py-tests lifter surface for native unittest.TestCase assertions
  • lift assertIsNone, assertIsNotNone, assertTrue, and assertFalse into normalized contracts
  • emit structured lift-gap warnings for unsupported unittest assertions instead of fake contracts
  • add package and RPC protocol coverage for normalized output and gaps

Verification

  • python3 -m pytest implementations/python/provekit-lift-py-tests/tests -q
  • cargo test -p provekit-cli --test cmd_mint_python_project_implications --manifest-path implementations/rust/Cargo.toml python_implication_consumer_mints_bridge_from_manifest_rpc -- --nocapture
  • git diff --check

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Warning

Review limit reached

@TSavo, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 58 minutes and 20 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fdd17b17-5b98-4d5c-b229-67ddf5f2b016

📥 Commits

Reviewing files that changed from the base of the PR and between 1890ff8 and 107de4c.

📒 Files selected for processing (3)
  • implementations/python/provekit-lift-py-tests/src/provekit_lift_py_tests/layer2.py
  • implementations/python/provekit-lift-py-tests/tests/test_daemon_protocol.py
  • implementations/python/provekit-lift-py-tests/tests/test_layer2.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/python-unittest-lifter-20260529

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a 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: 1763dd6aed

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

name = _attr_method_name(call.func)
if name is None:
continue
if not name.startswith("assert"):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Limit lift-gap claims to unittest assertions

In pytest tests that use mocks, calls like mock.assert_called_once_with(...) or spy.assert_any_call(...) satisfy this startswith("assert") check even though they are mock-verification APIs, not unittest TestCase assertions. Because the caller then adds the test to claimed_tests without emitting a contract, those tests are no longer left for Layer 0/3 as the README dispatch model describes, so existing mock-heavy pytest tests can be swallowed with only a lift-gap warning. Please gate this path on an actual unittest-style receiver/context (e.g. self.assert... in a TestCase method) rather than any attribute named assert*.

Useful? React with 👍 / 👎.

@TSavo TSavo force-pushed the codex/python-unittest-lifter-20260529 branch from 1763dd6 to a87bc71 Compare May 29, 2026 19:04
@TSavo TSavo force-pushed the codex/python-unittest-lifter-20260529 branch from a87bc71 to 107de4c Compare May 29, 2026 19:05
@TSavo TSavo merged commit caa6a88 into main May 29, 2026
4 of 6 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.

1 participant