Skip to content

Commit d77c204

Browse files
authored
PYTHON-2940 Fix spec tests that require DNSPython (#756)
1 parent a94916e commit d77c204

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/test_uri_spec.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424

2525
from pymongo.common import INTERNAL_URI_OPTION_NAME_MAP, validate
2626
from pymongo.compression_support import _HAVE_SNAPPY
27-
from pymongo.uri_parser import parse_uri
27+
from pymongo.srv_resolver import _HAVE_DNSPYTHON
28+
from pymongo.uri_parser import parse_uri, SRV_SCHEME
2829
from test import clear_warning_registry, unittest
2930

3031

@@ -92,7 +93,8 @@ def run_scenario(self):
9293
compressors = (test.get('options') or {}).get('compressors', [])
9394
if 'snappy' in compressors and not _HAVE_SNAPPY:
9495
self.skipTest('This test needs the snappy module.')
95-
96+
if test['uri'].startswith(SRV_SCHEME) and not _HAVE_DNSPYTHON:
97+
self.skipTest("This test needs dnspython package.")
9698
valid = True
9799
warning = False
98100

0 commit comments

Comments
 (0)