Skip to content

Commit dfbcb9f

Browse files
committed
cleanup
1 parent fb32023 commit dfbcb9f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

tests/test_resolver.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ def check_no_lingering_resolvers() -> Generator[None, None, None]:
5959
before = len(manager._loop_data)
6060
yield
6161
after = len(manager._loop_data)
62-
if after > before:
62+
if after > before: # pragma: no branch
6363
# Force garbage collection to ensure weak references are updated
64-
gc.collect()
65-
after = len(manager._loop_data)
66-
if after > before:
67-
pytest.fail(
64+
gc.collect() # pragma: no cover
65+
after = len(manager._loop_data) # pragma: no cover
66+
if after > before: # pragma: no cover
67+
pytest.fail( # pragma: no cover
6868
f"Lingering resolvers found: {(after - before)} "
6969
"new AsyncResolver instances were not properly closed."
7070
)
@@ -76,9 +76,6 @@ def dns_resolver_manager() -> Generator[_DNSResolverManager, None, None]:
7676
7777
Saves and restores the singleton state to avoid affecting other tests.
7878
"""
79-
if aiodns is None:
80-
pytest.skip("aiodns is required")
81-
8279
# Save the original instance
8380
original_instance = _DNSResolverManager._instance
8481

0 commit comments

Comments
 (0)