MCPcopy Create free account
hub / github.com/apache/arrow / pytest_addoption

Function pytest_addoption

python/pyarrow/tests/conftest.py:64–85  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

62
63
64def 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
88class PyArrowConfig:

Callers

nothing calls this directly

Calls 1

bool_envFunction · 0.85

Tested by

no test coverage detected