Commit 3e25597
Make AsyncCursor.callproc sync like its siblings
AsyncCursor exposed three PEP 249 optional extensions that all raise
NotSupportedError unconditionally: ``callproc``, ``nextset``,
``scroll``. Two were plain methods and one (``callproc``) was
``async def``, so ``cursor.callproc("x")`` returned a coroutine
instead of raising. A caller wrapping the call in a bare ``try ...
except NotSupportedError`` would silently see the try block pass and
then leak a never-awaited coroutine.
The method only ever raises; wrapping in a coroutine provided no
value and diverged from the two sibling raisers on the same class
plus ``AsyncAdaptedCursor.callproc`` in the SQLAlchemy dialect. Drop
``async``.
Update the existing raise test to drop the ``await`` and the stale
``@pytest.mark.asyncio`` marker, and add a guardrail test that
inspects all three methods with ``inspect.iscoroutinefunction`` so
future drift is caught.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6d2c4f7 commit 3e25597
2 files changed
+24
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
258 | 265 | | |
259 | 266 | | |
260 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
| 114 | + | |
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
120 | 119 | | |
121 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
122 | 134 | | |
123 | 135 | | |
124 | 136 | | |
| |||
0 commit comments