Skip to content

Commit 32fabb9

Browse files
committed
fix tests
1 parent 99a07fe commit 32fabb9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

pymongo/asynchronous/srv_resolver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ async def _resolve(*args: Any, **kwargs: Any) -> resolver.Answer:
5656
# dnspython 1.X
5757
return resolver.query(*args, **kwargs)
5858
else:
59-
from dns.asyncresolver import Resolver
59+
from dns import asyncresolver
6060

61-
return await Resolver.resolve(*args, **kwargs) # type:ignore[return-value]
61+
return await asyncresolver.resolve(*args, **kwargs) # type:ignore[return-value]
6262

6363

6464
_INVALID_HOST_MSG = (

pymongo/synchronous/srv_resolver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ def _resolve(*args: Any, **kwargs: Any) -> resolver.Answer:
5656
# dnspython 1.X
5757
return resolver.query(*args, **kwargs)
5858
else:
59-
from dns.asyncresolver import Resolver
59+
from dns import asyncresolver
6060

61-
return Resolver.resolve(*args, **kwargs) # type:ignore[return-value]
61+
return asyncresolver.resolve(*args, **kwargs) # type:ignore[return-value]
6262

6363

6464
_INVALID_HOST_MSG = (

test/asynchronous/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ def test_validate_suggestion(self):
607607
with self.assertRaisesRegex(ConfigurationError, expected):
608608
AsyncMongoClient(**{typo: "standard"}) # type: ignore[arg-type]
609609

610-
@patch("pymongo.srv_resolver._SrvResolver.get_hosts")
610+
@patch("pymongo.asynchronous.srv_resolver._SrvResolver.get_hosts")
611611
def test_detected_environment_logging(self, mock_get_hosts):
612612
normal_hosts = [
613613
"normal.host.com",
@@ -629,7 +629,7 @@ def test_detected_environment_logging(self, mock_get_hosts):
629629
logs = [record.getMessage() for record in cm.records if record.name == "pymongo.client"]
630630
self.assertEqual(len(logs), 7)
631631

632-
@patch("pymongo.srv_resolver._SrvResolver.get_hosts")
632+
@patch("pymongo.asynchronous.srv_resolver._SrvResolver.get_hosts")
633633
async def test_detected_environment_warning(self, mock_get_hosts):
634634
with self._caplog.at_level(logging.WARN):
635635
normal_hosts = [

0 commit comments

Comments
 (0)