Skip to content

test: fix possibly-undefined and deprecated call sites - #681

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/jd/chore/mypy-strictness/fix-possibly-undefined-deprecated-call-sites--135cf536
Aug 5, 2026
Merged

test: fix possibly-undefined and deprecated call sites#681
mergify[bot] merged 1 commit into
mainfrom
devs/jd/chore/mypy-strictness/fix-possibly-undefined-deprecated-call-sites--135cf536

Conversation

@jd

@jd jd commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Two more error codes mypy leaves off under strict, both with real hits
in the test suite.

possibly-undefined: test_retry_state bound retry_state only inside
an except ExtractCallState block, then used it unconditionally. Had the
retry stopped raising, the test would have failed with NameError instead
of a useful assertion. Use assertRaises as a context manager, which both
asserts the exception is raised and binds the state unconditionally.

deprecated: asyncio.iscoroutinefunction is deprecated since 3.14 and
removed in 3.16, and was emitting a DeprecationWarning on every test run.
The line right below it already asserts the same property via
inspect.iscoroutinefunction, which is the documented replacement, so drop
the deprecated call rather than pin the suite to an API that is going away.

@jd

jd commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 test: fix possibly-undefined and deprecated call sites #681 👈
2 refactor: mark overridden methods with @OverRide #682

@jd
jd marked this pull request as ready for review August 5, 2026 15:35
@jd
jd force-pushed the devs/jd/chore/mypy-strictness/fix-possibly-undefined-deprecated-call-sites--135cf536 branch from cdd9c7b to dbf3491 Compare August 5, 2026 15:39
@jd
jd force-pushed the devs/jd/chore/mypy-strictness/declare-baseaction-s-repr-fields-name-classvar--012caeaa branch from 83a4c19 to 227f834 Compare August 5, 2026 15:39
@jd

jd commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

Revision history

# Type Changes Reason Date
1 initial cdd9c7b 2026-08-05 15:39 UTC
2 rebase cdd9c7b → dbf3491 (rebase only) 2026-08-05 15:39 UTC
3 rebase dbf3491 → dc1546e (rebase only) 2026-08-05 15:47 UTC
4 rebase dc1546e → d245e46 (rebase only) 2026-08-05 15:59 UTC

@mergify mergify Bot added the queued label Aug 5, 2026
@mergify

mergify Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-08-05 15:41 UTC · Rule: default · triggered by rule autoqueue
  • Checks skipped · PR is already up-to-date
  • 🚫 Left the queue2026-08-05 15:43 UTC · at dbf34914f7a03dd889480012dbf17b1a48e7f858

This pull request spent 1 minute 59 seconds in the queue, including 10 seconds running CI.

Waiting for
All conditions

Reason

Pull request #681 has been dequeued

Queue conditions are not satisfied:

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Requeued — the merge queue status continues in this comment ↓.

@mergify mergify Bot added dequeued and removed queued labels Aug 5, 2026
@jd
jd force-pushed the devs/jd/chore/mypy-strictness/declare-baseaction-s-repr-fields-name-classvar--012caeaa branch from 227f834 to 4fc0664 Compare August 5, 2026 15:47
@jd
jd force-pushed the devs/jd/chore/mypy-strictness/fix-possibly-undefined-deprecated-call-sites--135cf536 branch from dbf3491 to dc1546e Compare August 5, 2026 15:47
@mergify mergify Bot removed the dequeued label Aug 5, 2026
@mergify

mergify Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 minute 8 seconds in the queue, including 16 seconds running CI.

Required conditions to merge

Reason

Pull request #681 has been dequeued

GitHub refused to merge the pull request. Pull Request has merge conflicts. This is usually enforced by a branch protection or ruleset rule.

Failing checks:

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Requeued — the merge queue status continues in this comment ↓.

@mergify mergify Bot added the queued label Aug 5, 2026
Base automatically changed from devs/jd/chore/mypy-strictness/declare-baseaction-s-repr-fields-name-classvar--012caeaa to main August 5, 2026 15:49
@mergify mergify Bot added dequeued and removed queued labels Aug 5, 2026
Two more error codes mypy leaves off under `strict`, both with real hits
in the test suite.

`possibly-undefined`: `test_retry_state` bound `retry_state` only inside
an `except ExtractCallState` block, then used it unconditionally. Had the
retry stopped raising, the test would have failed with `NameError` instead
of a useful assertion. Use `assertRaises` as a context manager, which both
asserts the exception is raised and binds the state unconditionally.

`deprecated`: `asyncio.iscoroutinefunction` is deprecated since 3.14 and
removed in 3.16, and was emitting a `DeprecationWarning` on every test run.
The line right below it already asserts the same property via
`inspect.iscoroutinefunction`, which is the documented replacement, so drop
the deprecated call rather than pin the suite to an API that is going away.

Change-Id: I135cf5364f3e471d954c878f2599be7441104971
@jd
jd force-pushed the devs/jd/chore/mypy-strictness/fix-possibly-undefined-deprecated-call-sites--135cf536 branch from dc1546e to d245e46 Compare August 5, 2026 15:59
@mergify mergify Bot removed the dequeued label Aug 5, 2026
@mergify

mergify Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-08-05 16:00 UTC · Rule: default · triggered by rule autoqueue
  • Checks skipped · PR is already up-to-date
  • Merged2026-08-05 16:00 UTC · at d245e46bf76ddbab0a6d92ede12b35f93bdd7ea8 · squash

This pull request spent 11 seconds in the queue, including 1 second running CI.

Required conditions to merge

@mergify mergify Bot added the queued label Aug 5, 2026
@mergify
mergify Bot merged commit b189e15 into main Aug 5, 2026
9 of 16 checks passed
@mergify
mergify Bot deleted the devs/jd/chore/mypy-strictness/fix-possibly-undefined-deprecated-call-sites--135cf536 branch August 5, 2026 16:00
@mergify mergify Bot removed the queued label Aug 5, 2026
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