Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Besides, replace
unittest.mock
+aynctest
with backportedmock
to support Python 3.7–3.11. The root of the conflict between 3.7 and 3.11 isasynctest
, which is intensively used in the unit tests.Python 3.11 removed
@asyncio.coroutine
(it was issuing warnings since Python 3.8). As a result,asynctest
is completely broken in 3.11. The latest commit ofasynctest
is 3 years old (Nov 2019; now is Nov 2022), soasynctest
can be deemed unmaintained.The closest equivalent of
asynctest
isunittest.mock.AsyncMock
, but it is available in Python 3.8 only. Python 3.7 can be supported with a back-ported standalone librarymock
. But if we use it, we should use it consistently in all places, not mixed with the StdLib'sunittest.mock
.An alternative would be to drop Python 3.7 support prematurely — 8 months before its official end of life (Jun 2023) — in order to support Python 3.11 now.