Skip to content

Commit fd26187

Browse files
committed
chore: Add version check to only allow no-Pandas for 3.14, plus a TODO
1 parent e315bb7 commit fd26187

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tests/conftest.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import sys
23
import pytest
34
import shutil
45
from os.path import abspath, join, dirname, normpath
@@ -52,16 +53,22 @@ def import_pandas():
5253
def pytest_addoption(parser):
5354
parser.addoption("--skiplist", action="append", nargs="+", type=str, help="skip listed tests")
5455

56+
5557
@pytest.hookimpl(hookwrapper=True)
5658
def pytest_runtest_call(item):
5759
"""Convert pandas requirement exceptions to skips"""
60+
5861
outcome = yield
59-
try:
60-
outcome.get_result()
61-
except Exception as e:
62-
if "'pandas' is required for this operation but it was not installed" in str(e):
63-
pytest.skip("pandas not available - test requires pandas functionality")
6462

63+
# TODO: Remove skip when Pandas releases for 3.14. After, consider bumping to 3.15
64+
if sys.version_info[:2] == (3, 14):
65+
try:
66+
outcome.get_result()
67+
except Exception as e:
68+
if "'pandas' is required for this operation but it was not installed" in str(e):
69+
pytest.skip("pandas not available - test requires pandas functionality")
70+
else:
71+
raise e
6572

6673

6774
def pytest_collection_modifyitems(config, items):

0 commit comments

Comments
 (0)