(collection_path, config)
| 210 | |
| 211 | # Doctest should ignore files for the modules that are not built |
| 212 | def pytest_ignore_collect(collection_path, config): |
| 213 | def _cuda_is_available(): |
| 214 | try: |
| 215 | import pyarrow.cuda # noqa |
| 216 | return True |
| 217 | except ImportError: |
| 218 | return False |
| 219 | |
| 220 | if config.option.doctestmodules: |
| 221 | # don't try to run doctests on the /tests directory |
| 222 | if "/pyarrow/tests/" in str(collection_path): |
| 223 | return True |
| 224 | |
| 225 | doctest_groups = [ |
| 226 | 'dataset', |
| 227 | 'orc', |
| 228 | 'parquet', |
| 229 | 'flight', |
| 230 | 'substrait', |
| 231 | ] |
| 232 | |
| 233 | # handle cuda, flight, etc |
| 234 | for group in doctest_groups: |
| 235 | if f'pyarrow/{group}' in str(collection_path): |
| 236 | if not defaults[group]: |
| 237 | return True |
| 238 | |
| 239 | if 'pyarrow/parquet/encryption' in str(collection_path): |
| 240 | if not defaults['parquet_encryption']: |
| 241 | return True |
| 242 | |
| 243 | if 'pyarrow/cuda' in str(collection_path): |
| 244 | return not _cuda_is_available() |
| 245 | |
| 246 | if 'pyarrow/fs' in str(collection_path): |
| 247 | try: |
| 248 | from pyarrow.fs import S3FileSystem # noqa |
| 249 | return False |
| 250 | except ImportError: |
| 251 | return True |
| 252 | |
| 253 | if getattr(config.option, "doctest_cython", False): |
| 254 | if "/pyarrow/tests/" in str(collection_path): |
| 255 | return True |
| 256 | if "/pyarrow/_parquet_encryption" in str(collection_path): |
| 257 | return True |
| 258 | if "/pyarrow/_cuda" in str(collection_path): |
| 259 | return not _cuda_is_available() |
| 260 | |
| 261 | return False |
| 262 | |
| 263 | |
| 264 | # Save output files from doctest examples into temp dir |
nothing calls this directly
no test coverage detected