Skip to content

Commit 531e9c9

Browse files
committed
Add dns.resolver.resolve to synchro
1 parent 4e3d524 commit 531e9c9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

test/test_dns.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ class TestInitialDnsSeedlistDiscovery(PyMongoTestCase):
208208

209209
def run_initial_dns_seedlist_discovery_prose_tests(self, test_cases):
210210
for case in test_cases:
211-
with patch("dns.asyncresolver.resolve") as mock_resolver:
211+
with patch("dns.resolver.resolve") as mock_resolver:
212212

213213
def mock_resolve(query, record_type, *args, **kwargs):
214214
mock_srv = MagicMock()
@@ -226,7 +226,7 @@ def mock_resolve(query, record_type, *args, **kwargs):
226226
self.fail(f"ConfigurationError was not raised for query: {case['query']}")
227227

228228
def test_1_allow_srv_hosts_with_fewer_than_three_dot_separated_parts(self):
229-
with patch("dns.asyncresolver.resolve"):
229+
with patch("dns.resolver.resolve"):
230230
parse_uri("mongodb+srv://localhost/")
231231
parse_uri("mongodb+srv://mongo.local/")
232232

tools/synchro.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
"async_joinall": "joinall",
134134
"_async_create_connection": "_create_connection",
135135
"pymongo.asynchronous.srv_resolver._SrvResolver.get_hosts": "pymongo.synchronous.srv_resolver._SrvResolver.get_hosts",
136+
"dns.asyncresolver.resolve": "dns.resolver.resolve",
136137
}
137138

138139
docstring_replacements: dict[tuple[str, str], str] = {

0 commit comments

Comments
 (0)