(parser)
| 62 | |
| 63 | |
| 64 | def pytest_addoption(parser): |
| 65 | # Create options to selectively enable test groups |
| 66 | def bool_env(name, default=None): |
| 67 | value = os.environ.get(name.upper()) |
| 68 | if not value: # missing or empty |
| 69 | return default |
| 70 | value = value.lower() |
| 71 | if value in {'1', 'true', 'on', 'yes', 'y'}: |
| 72 | return True |
| 73 | elif value in {'0', 'false', 'off', 'no', 'n'}: |
| 74 | return False |
| 75 | else: |
| 76 | raise ValueError(f'{name.upper()}={value} is not parsable as boolean') |
| 77 | |
| 78 | for group in groups: |
| 79 | default = bool_env(f'PYARROW_TEST_{group}', defaults[group]) |
| 80 | parser.addoption(f'--enable-{group}', |
| 81 | action='store_true', default=default, |
| 82 | help=(f'Enable the {group} test group')) |
| 83 | parser.addoption(f'--disable-{group}', |
| 84 | action='store_true', default=False, |
| 85 | help=(f'Disable the {group} test group')) |
| 86 | |
| 87 | |
| 88 | class PyArrowConfig: |
nothing calls this directly
no test coverage detected