Skip to content

Use timeout instead of num_sec with integer values#307

Merged
mshriver merged 2 commits into
RedHatQE:mainfrom
mshriver:wait-for-timeout
Jun 2, 2026
Merged

Use timeout instead of num_sec with integer values#307
mshriver merged 2 commits into
RedHatQE:mainfrom
mshriver:wait-for-timeout

Conversation

@mshriver

@mshriver mshriver commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

preparation for wait_for v2

the timeout kwarg should be an integer, float, or timedelta instance.

Summary by Sourcery

Enhancements:

  • Align wait_for invocation with the new timeout keyword argument instead of the deprecated num_sec parameter.

Copilot AI review requested due to automatic review settings June 1, 2026 11:46
@sourcery-ai

sourcery-ai Bot commented Jun 1, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Replaces the deprecated num_sec argument with the new timeout argument in an internal wait_for call to prepare for wait_for v2 API changes.

Sequence diagram for internal wait_for timeout usage change

sequenceDiagram
    participant Browser
    participant wait_for

    Browser->>wait_for: _check_for_new_pages, timeout=1.0, delay=0.05, message, silent_failure
    wait_for-->>Browser: result
Loading

File-Level Changes

Change Details Files
Update internal wait_for invocation to use the new timeout parameter name.
  • Change the keyword argument from num_sec to timeout for a short wait_for call used when checking for new pages
  • Preserve existing timeout value, delay, message, and silent_failure behavior while adapting to the upcoming wait_for v2 signature
src/widgetastic/browser.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai 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.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@mshriver mshriver force-pushed the wait-for-timeout branch from d25ff86 to 709e780 Compare June 1, 2026 11:47

Copilot AI 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.

Pull request overview

This PR updates the wait_for usage in widgetastic.browser to use the timeout keyword argument instead of the deprecated num_sec, aligning the codebase with the upcoming wait_for v2 API.

Changes:

  • Replaced num_sec=1.0 with timeout=1.0 in the short best-effort new-page detection wait.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.72%. Comparing base (b3598bd) to head (dd259e1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #307   +/-   ##
=======================================
  Coverage   92.72%   92.72%           
=======================================
  Files          19       19           
  Lines        2750     2750           
=======================================
  Hits         2550     2550           
  Misses        200      200           
Flag Coverage Δ
unittests 92.72% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mshriver mshriver force-pushed the wait-for-timeout branch 2 times, most recently from 0925172 to d1ec4ce Compare June 1, 2026 13:23
@mshriver mshriver requested a review from Copilot June 1, 2026 13:23

Copilot AI 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.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comment thread src/widgetastic/utils.py
Comment thread src/widgetastic/widget/base.py
Comment thread src/widgetastic/widget/base.py
@mshriver mshriver changed the title Use timeout instead of num_sec Use timeout instead of num_sec with integer values Jun 2, 2026
preparation for wait_for v2

Co-authored-by: Claude <noreply@anthropic.com>
@mshriver mshriver force-pushed the wait-for-timeout branch from 6a12ce7 to e162439 Compare June 2, 2026 07:45

@swadeley swadeley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ACK

@mshriver mshriver merged commit ebaeb72 into RedHatQE:main Jun 2, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants