diff --git a/test/test_uri_spec.py b/test/test_uri_spec.py index cfca63345..2646f02e4 100644 --- a/test/test_uri_spec.py +++ b/test/test_uri_spec.py @@ -24,7 +24,8 @@ sys.path[0:0] = [""] from pymongo.common import INTERNAL_URI_OPTION_NAME_MAP, validate from pymongo.compression_support import _HAVE_SNAPPY -from pymongo.uri_parser import parse_uri +from pymongo.srv_resolver import _HAVE_DNSPYTHON +from pymongo.uri_parser import parse_uri, SRV_SCHEME from test import clear_warning_registry, unittest @@ -92,7 +93,8 @@ def create_test(test, test_workdir): compressors = (test.get('options') or {}).get('compressors', []) if 'snappy' in compressors and not _HAVE_SNAPPY: self.skipTest('This test needs the snappy module.') - + if test['uri'].startswith(SRV_SCHEME) and not _HAVE_DNSPYTHON: + self.skipTest("This test needs dnspython package.") valid = True warning = False