test: fix possibly-undefined and deprecated call sites - #681
Conversation
|
This pull request is part of a Mergify stack:
|
cdd9c7b to
dbf3491
Compare
83a4c19 to
227f834
Compare
Revision history
|
Merge Queue Status
This pull request spent 1 minute 59 seconds in the queue, including 10 seconds running CI. Waiting for
All conditions
ReasonPull request #681 has been dequeued Queue conditions are not satisfied:
HintYou 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. Requeued — the merge queue status continues in this comment ↓. |
227f834 to
4fc0664
Compare
dbf3491 to
dc1546e
Compare
Merge Queue Status
This pull request spent 1 minute 8 seconds in the queue, including 16 seconds running CI. Required conditions to merge
ReasonPull 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: HintYou 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. Requeued — the merge queue status continues in this comment ↓. |
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
dc1546e to
d245e46
Compare
Merge Queue Status
This pull request spent 11 seconds in the queue, including 1 second running CI. Required conditions to merge
|
Two more error codes mypy leaves off under
strict, both with real hitsin the test suite.
possibly-undefined:test_retry_stateboundretry_stateonly insidean
except ExtractCallStateblock, then used it unconditionally. Had theretry stopped raising, the test would have failed with
NameErrorinsteadof a useful assertion. Use
assertRaisesas a context manager, which bothasserts the exception is raised and binds the state unconditionally.
deprecated:asyncio.iscoroutinefunctionis deprecated since 3.14 andremoved in 3.16, and was emitting a
DeprecationWarningon every test run.The line right below it already asserts the same property via
inspect.iscoroutinefunction, which is the documented replacement, so dropthe deprecated call rather than pin the suite to an API that is going away.