From 9d95e8a2724be2145a4f8c07d5d266dca7fd2fb1 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 22 Oct 2022 21:58:01 +0100 Subject: [PATCH] Update test_connector.py --- tests/test_connector.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_connector.py b/tests/test_connector.py index ee734acb32c..79bfaedb76c 100644 --- a/tests/test_connector.py +++ b/tests/test_connector.py @@ -2190,7 +2190,9 @@ def test_expired_ttl(self, monkeypatch: pytest.MonkeyPatch) -> None: def test_never_expire(self) -> None: dns_cache_table = _DNSCacheTable(ttl=None) + monkeypatch.setattr("aiohttp.connector.monotonic", lambda: 1) dns_cache_table.add("localhost", ["127.0.0.1"]) + monkeypatch.setattr("aiohttp.connector.monotonic", lambda: 10000000) assert not dns_cache_table.expired("localhost") def test_always_expire(self, monkeypatch: pytest.MonkeyPatch) -> None: