Skip to content

Commit

Permalink
[Python] Adapt to modified pytest hook api
Browse files Browse the repository at this point in the history
  • Loading branch information
robvanmieghem committed Jan 4, 2025
1 parent 3752109 commit 032fb7e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions python/pyarrow/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@


# Doctest should ignore files for the modules that are not built
def pytest_ignore_collect(path, config):
def pytest_ignore_collect(collection_path, config):
if config.option.doctestmodules:
# don't try to run doctests on the /tests directory
if "/pyarrow/tests/" in str(path):
if "/pyarrow/tests/" in str(collection_path):
return True

doctest_groups = [
Expand All @@ -233,32 +233,32 @@ def pytest_ignore_collect(path, config):

# handle cuda, flight, etc
for group in doctest_groups:
if 'pyarrow/{}'.format(group) in str(path):
if 'pyarrow/{}'.format(group) in str(collection_path):
if not defaults[group]:
return True

if 'pyarrow/parquet/encryption' in str(path):
if 'pyarrow/parquet/encryption' in str(collection_path):
if not defaults['parquet_encryption']:
return True

if 'pyarrow/cuda' in str(path):
if 'pyarrow/cuda' in str(collection_path):
try:
import pyarrow.cuda # noqa
return False
except ImportError:
return True

if 'pyarrow/fs' in str(path):
if 'pyarrow/fs' in str(collection_path):
try:
from pyarrow.fs import S3FileSystem # noqa
return False
except ImportError:
return True

if getattr(config.option, "doctest_cython", False):
if "/pyarrow/tests/" in str(path):
if "/pyarrow/tests/" in str(collection_path):
return True
if "/pyarrow/_parquet_encryption" in str(path):
if "/pyarrow/_parquet_encryption" in str(collection_path):
return True

return False
Expand Down

0 comments on commit 032fb7e

Please sign in to comment.