Fixed failing test case edgecase on Windows runners only.
@@ -297,10 +297,6 @@ class TestRunOnceShielded:
client._dispatch = mock.AsyncMock()
# Disable backoff checking by making the condition a negative tautology.
client._RESTART_RATELIMIT_WINDOW = -1
- # First call is used for backoff checks, the second call is used
- # for updating the _last_run_started_at attribute.
- # 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, ..., ..., ...
- client._now_monotonic = mock.MagicMock(side_effect=map(lambda n: n / 2, range(1, 100)))
return client
@hikari_test_helpers.timeout()
@@ -537,7 +533,7 @@ class TestRunOnce:
@hikari_test_helpers.timeout()
async def test_backoff_does_not_trigger_if_not_restarting_in_small_window(self, client, client_session):
- client._now_monotonic = mock.MagicMock(return_value=60)
+ with mock.patch.object(hikari_date, "monotonic", return_value=60):
client._last_run_started_at = 40
client._backoff.__next__ = mock.MagicMock(
side_effect=AssertionError(
