-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add regression test for #4505 #6417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughA regression test is added to Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes This is a straightforward test addition with minimal logic. The changes consist of a simple assertion block and formatting adjustments with no complex logic or structural modifications. Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
extra_tests/snippets/code_co_names.py (2)
5-10: Core nested-function assertion matches the reported CPython behavior. This should catch the__doc__-in-co_namesregression for nested defs.
Optional: add a blank line between thedef foo(): ...block and the module-levelassertto avoid potential ruff/PEP8 E305 noise if these snippets are linted.
11-19: Modulecompile()case is well-targeted; consider hardening style/diagnostics.
- Line 13: the blank line inside
stmtsappears to include a stray space; I’d drop it to avoid “trailing whitespace” tooling complaints.- Consider adding assertion messages (both asserts) so failures clearly show the unexpected
co_namesvalue.
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
extra_tests/snippets/code_co_names.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.py: In most cases, Python code should not be edited; bug fixes should be made through Rust code modifications only
Follow PEP 8 style for custom Python code
Use ruff for linting Python code
Files:
extra_tests/snippets/code_co_names.py
🧬 Code graph analysis (1)
extra_tests/snippets/code_co_names.py (1)
crates/vm/src/builtins/code.rs (1)
co_names(578-587)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Check the WASM package and demo
- GitHub Check: Run rust tests (windows-latest)
- GitHub Check: Run snippets and cpython tests (ubuntu-latest)
- GitHub Check: Run snippets and cpython tests on wasm-wasi
- GitHub Check: Ensure compilation on various targets
🔇 Additional comments (1)
extra_tests/snippets/code_co_names.py (1)
1-3: Good: direct regression linkage to #4505. The header docstring makes the intent/traceability clear.
| with assert_raises(TypeError): | ||
| del int.__qualname__ | ||
|
|
||
| from testutils import assert_raises |
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.
Maybe we should also run ruff check --select I in our CI 🤔
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.
how about just put it in auto-format and add some files to blocklist
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
extra_tests/snippets/builtin_type.py (1)
610-628: Regression test matches issue intent; consider making the moduleco_namesassertion less brittle if it flakes.The nested-function and
compile()cases directly cover “__doc__leaking intoco_names”. If CI ever shows ordering/extra-name differences that aren’t__doc__, loosening toassert "__doc__" not in code.co_namesplus presence checks for"blah"/"foo"would keep the test focused on #4505.
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
extra_tests/snippets/builtin_type.py(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.py: In most cases, Python code should not be edited; bug fixes should be made through Rust code modifications only
Follow PEP 8 style for custom Python code
Use ruff for linting Python code
Files:
extra_tests/snippets/builtin_type.py
🧬 Code graph analysis (1)
extra_tests/snippets/builtin_type.py (2)
extra_tests/snippets/testutils.py (1)
assert_raises(5-12)crates/vm/src/builtins/code.rs (1)
co_names(578-587)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: Run rust tests (ubuntu-latest)
- GitHub Check: Run snippets and cpython tests on wasm-wasi
- GitHub Check: Run snippets and cpython tests (ubuntu-latest)
- GitHub Check: Run snippets and cpython tests (macos-latest)
- GitHub Check: Run rust tests (macos-latest)
- GitHub Check: Run snippets and cpython tests (windows-latest)
- GitHub Check: Run rust tests (windows-latest)
- GitHub Check: Check the WASM package and demo
- GitHub Check: Ensure compilation on various targets
- GitHub Check: Run tests under miri
- GitHub Check: Check Rust code with clippy
🔇 Additional comments (1)
extra_tests/snippets/builtin_type.py (1)
1-4: Import move is fine; keep it stable per lint conventions.
I cannot reproduce this on 75dcf80.
Closes #4505
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.