Skip to content

Conversation

@dkropachev
Copy link
Collaborator

@dkropachev dkropachev commented Feb 1, 2026

Summary

  • Remove unmaintained asynctest dependency (last release 2020, incompatible with Python 3.12+)
  • Replace asynctest.TestSelector with MagicMock(spec=selectors.BaseSelector) in asyncio reactor tests
  • Uses Python stdlib's unittest.mock and selectors modules
  • Fix flaky test_multi_timer_validation test on Windows CI by increasing timer tolerance from 150ms to 500ms

Test plan

  • Verified no remaining references to asynctest in codebase
  • Unit tests pass: uv run pytest tests/unit/io/test_asyncioreactor.py
  • Timer test passes locally: uv run pytest tests/unit/io/test_twistedreactor.py::TestTwistedTimer::test_multi_timer_validation

Fixes #663

@dkropachev dkropachev self-assigned this Feb 1, 2026
The asynctest package is unmaintained since 2020 and incompatible with
Python 3.12+. Replace asynctest.TestSelector with a MagicMock using
selectors.BaseSelector as its spec, which provides the same mock
selector functionality needed by the asyncio reactor tests.

Fixes #663
Increase timer tolerance from 150ms to 500ms to account for CI
environments under heavy load, especially Windows during wheel
building where timing can be significantly less precise.
@dkropachev dkropachev force-pushed the remove-asynctest-dependency branch from e8b91ef to caf2f7a Compare February 2, 2026 12:34
@dkropachev dkropachev merged commit 19cd3e4 into master Feb 2, 2026
18 of 19 checks passed
@dkropachev dkropachev deleted the remove-asynctest-dependency branch February 2, 2026 12:34
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.

Replace asynctest with stdlib or pytest-asyncio

3 participants