Skip to content

Commit 929d362

Browse files
committed
add skip conditions
1 parent 69a5b80 commit 929d362

File tree

5 files changed

+33
-3
lines changed

5 files changed

+33
-3
lines changed

.evergreen/scripts/utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ def get_test_options(
134134
else:
135135
opts, extra_opts = parser.parse_known_args()
136136

137+
# Convert list inputs to strings.
138+
for name in vars(opts):
139+
value = getattr(opts, name)
140+
if isinstance(value, list):
141+
setattr(opts, name, value[0])
142+
137143
# Handle validation and environment variable overrides.
138144
test_name = opts.test_name
139145
sub_test_name = opts.sub_test_name if require_sub_test_name else ""

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dev = [
5050
"pre-commit>=4.0"
5151
]
5252
pip = ["pip>23.0"]
53-
gevent = ["gevent>=20.9"]
53+
gevent = ["gevent>=24.2.1"] # this is the first version with a universal macos wheel.
5454
eventlet = ["eventlet>0.29"]
5555
coverage = [
5656
"pytest-cov>=6.0",

test/asynchronous/test_dns.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import os
2121
import pathlib
2222
import sys
23+
from importlib import metadata
2324

2425
sys.path[0:0] = [""]
2526

@@ -30,8 +31,11 @@
3031
unittest,
3132
)
3233
from test.utils_shared import async_wait_until
34+
from test.version import Version
3335
from unittest.mock import MagicMock, patch
3436

37+
import pytest
38+
3539
from pymongo.asynchronous.uri_parser import parse_uri
3640
from pymongo.common import validate_read_preference_tags
3741
from pymongo.errors import ConfigurationError
@@ -209,6 +213,10 @@ class TestInitialDnsSeedlistDiscovery(AsyncPyMongoTestCase):
209213
"""
210214

211215
async def run_initial_dns_seedlist_discovery_prose_tests(self, test_cases):
216+
version = metadata.version("dnspython")
217+
# TODO: reference the Python 3.9 ticket.
218+
if Version.from_string(version) < Version(2, 0):
219+
pytest.skip("Test relies on dnspython 2.0+")
212220
for case in test_cases:
213221
with patch("dns.asyncresolver.resolve") as mock_resolver:
214222

@@ -231,6 +239,10 @@ async def mock_resolve(query, record_type, *args, **kwargs):
231239
self.fail(f"ConfigurationError was not raised for query: {case['query']}")
232240

233241
async def test_1_allow_srv_hosts_with_fewer_than_three_dot_separated_parts(self):
242+
# TODO: reference the Python 3.9 ticket.
243+
version = metadata.version("dnspython")
244+
if Version.from_string(version) < Version(2, 0):
245+
pytest.skip("Test relies on dnspython 2.0+")
234246
with patch("dns.asyncresolver.resolve"):
235247
await parse_uri("mongodb+srv://localhost/")
236248
await parse_uri("mongodb+srv://mongo.local/")

test/test_dns.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import os
2121
import pathlib
2222
import sys
23+
from importlib import metadata
2324

2425
sys.path[0:0] = [""]
2526

@@ -30,8 +31,11 @@
3031
unittest,
3132
)
3233
from test.utils_shared import wait_until
34+
from test.version import Version
3335
from unittest.mock import MagicMock, patch
3436

37+
import pytest
38+
3539
from pymongo.common import validate_read_preference_tags
3640
from pymongo.errors import ConfigurationError
3741
from pymongo.synchronous.uri_parser import parse_uri
@@ -207,6 +211,10 @@ class TestInitialDnsSeedlistDiscovery(PyMongoTestCase):
207211
"""
208212

209213
def run_initial_dns_seedlist_discovery_prose_tests(self, test_cases):
214+
version = metadata.version("dnspython")
215+
# TODO: reference the Python 3.9 ticket.
216+
if Version.from_string(version) < Version(2, 0):
217+
pytest.skip("Test relies on dnspython 2.0+")
210218
for case in test_cases:
211219
with patch("dns.resolver.resolve") as mock_resolver:
212220

@@ -229,6 +237,10 @@ def mock_resolve(query, record_type, *args, **kwargs):
229237
self.fail(f"ConfigurationError was not raised for query: {case['query']}")
230238

231239
def test_1_allow_srv_hosts_with_fewer_than_three_dot_separated_parts(self):
240+
# TODO: reference the Python 3.9 ticket.
241+
version = metadata.version("dnspython")
242+
if Version.from_string(version) < Version(2, 0):
243+
pytest.skip("Test relies on dnspython 2.0+")
232244
with patch("dns.resolver.resolve"):
233245
parse_uri("mongodb+srv://localhost/")
234246
parse_uri("mongodb+srv://mongo.local/")

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)