FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[update_lib] Fix async func auto-mark by youknowone · Pull Request #6903 · RustPython/RustPython · GitHub

[update_lib] Fix async func auto-mark - #6903

Merged
youknowone merged 3 commits into
RustPython:mainfrom
youknowone:automark
Jan 30, 2026
Merged

[update_lib] Fix async func auto-mark#6903
youknowone merged 3 commits into
RustPython:mainfrom
youknowone:automark

Conversation

youknowone commented Jan 30, 2026
edited by coderabbitai Bot
Loading

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Async test support extended: automatic async wrapper generation and improved handling of inherited async/sync tests.
    • Detection and reporting of unexpected test-success cases.
  • Improvements

    • Parser now handles multiline test result formats and aggregates overall test results.
    • Better extraction of failure/error messages and handling of async super-call patterns.
  • Tests

    • Expanded unit tests covering multiline parsing, async super-calls, and inheritance cases.

✏️ Tip: You can customize this high-level summary in your review settings.

youknowone marked this pull request as ready for review January 30, 2026 14:40

coderabbitai Bot commented Jan 30, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds multiline test-result parsing, UNEXPECTED SUCCESS and error-message extraction, async super-call detection (including awaited super calls), and async-test tracking with generation of async wrappers during patch creation.

Changes

Cohort / File(s) Summary
Test parsing & super-call detection
scripts/update_lib/cmd_auto_mark.py
Adds _try_parse_test_info(); extends parse_results() to handle multiline test entries, pending test info, UNEXPECTED SUCCESS, and error-message extraction; updates _is_super_call_only() to unwrap Await for async methods.
Async-aware patch generation
scripts/update_lib/patch_spec.py
Adds async_methods detection (scans for AsyncFunctionDef) and emits async def wrappers (with await super()...) for async tests while preserving sync wrapper behavior and decorator handling.
Unit tests
scripts/update_lib/tests/test_auto_mark.py
Adds new tests (~+166 LOC) covering multiline parsing, UNEXPECTED SUCCESS handling, async super-call cases, and Phase 2 inherited-test wrapper generation for both async and sync tests.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • moreal
  • ShaharNaveh

Poem

🐰
I nibble through lines of test and thread,
Multiline whispers traced and read,
Awaiting super with a nimble hop,
Async wrappers ready — non-stop,
Hooray — the patch-carrot’s on the top!

🚥 Pre-merge checks | ✅ 3 ✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[update_lib] Fix async func auto-mark' directly and clearly summarizes the main change: fixing async function handling in the auto-mark utility, which is the primary focus of all file modifications.
Docstring Coverage ✅ Passed Docstring coverage is 93.75% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
Contributor

Code has been automatically formatted

The code in this PR has been formatted using:

  • ruff format
    Please pull the latest changes before pushing again:
git pull origin automark

ShaharNaveh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Good catch!

coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@scripts/update_lib/patch_spec.py`:
- Around line 250-257: The async_methods set currently tracks only method names
(async_methods) causing incorrect async/signature detection; change
async_methods to record class+method context (e.g., store tuples like
(class_name, method_name) or a dict keyed by class name) when scanning AST (the
loop over tree.body that fills async_methods), and update the later check (where
is_async is computed from test_name) to look up using the class context (e.g.,
(current_class_name, test_name) or
async_methods[current_class_name].contains(test_name)) so async detection is
per-class rather than global.

Comment thread scripts/update_lib/patch_spec.py Outdated
youknowone added the skip:ci Skip running the ci label Jan 30, 2026
youknowone merged commit 528d657 into RustPython:main Jan 30, 2026
10 of 13 checks passed
youknowone deleted the automark branch January 30, 2026 15:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip:ci Skip running the ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL