Skip to content

[pull] main from nolar:main#72

Merged
pull[bot] merged 5 commits into
kp-forks:mainfrom
nolar:main
Jun 4, 2026
Merged

[pull] main from nolar:main#72
pull[bot] merged 5 commits into
kp-forks:mainfrom
nolar:main

Conversation

@pull

@pull pull Bot commented Jun 4, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

markafarrell and others added 5 commits June 3, 2026 16:18
Signed-off-by: Mark Farrell <mark.a.farrell@team.telstra.com>
It works in CPython (all versions). It works in PyPy 3.11.13. Only PyPy 3.11.15 has this problem.

The coro cancellation test fails with an existing warning while no warnings are expected. The warning is:

```
{message : RuntimeWarning("coroutine 'f' was never awaited"), category : 'RuntimeWarning', filename : '/Users/nolar/.pyenv/versions/pypy3.11-7.3.22/lib/pypy3.11/unittest/mock.py', lineno : 457, line : None}
```

When converted to errors:

```
    def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False,
                       _eat_self=False):
        ………
        for attr in dir(spec):
>           if iscoroutinefunction(getattr(spec, attr, None)):
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^
E           RuntimeWarning: coroutine 'f' was never awaited
```

As found manually, it fails on accessing the `coro.cr_frame` attribute while enumerating it — just accessing, not doing anything with it.

Removing the spec part of the async mock helps. It was only needed to ensure that `coro.close()` does not exist. Alternative: enumerate ourselves (`fields = dir(coro)`) and exclude the `cr_…` attributes in addition to `close()`, but also some other unsupported magic methods as per Mock/AsyncMock docs — I do not know which ones.

An artificial test to ensure the test fails when the bug is reproduced: in `cancel_coro()`, comment out the task creation and awaiting, in which case the `coro` remains unawaited and therefore issues a warning on garbage collection.

The extra line also fixes an issue when `coro` was still referenced by the mock and not garbage-collected (a pre-existing bug in the test).

Signed-off-by: Sergey Vasilyev <nolar@nolar.info>
Fix a test failure specifically in PyPy 3.11.15+
Signed-off-by: Sergey Vasilyev <nolar@nolar.info>
…es-36.0.1

Fix python kubernetes login for >= v36.0.1
@pull pull Bot locked and limited conversation to collaborators Jun 4, 2026
@pull pull Bot added the ⤵️ pull label Jun 4, 2026
@pull pull Bot merged commit 60d02ae into kp-forks:main Jun 4, 2026
11 of 22 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants