omertt27 opened a new pull request, #49475:
URL: https://github.com/apache/arrow/pull/49475
### Summary
Closes #49397.
This PR validates and fixes the `PYARROW_GENERATE_COVERAGE` flag so that
Cython coverage reporting works end-to-end for the PyArrow test suite.
### Changes
**`python/pyarrow/conftest.py`**
- Added a `pytest_configure` hook that activates the `Cython.Coverage`
plugin and calls `coverage.process_startup()` when
`PYARROW_GENERATE_COVERAGE` is set.
- This must run before any pyarrow modules are imported so that the
Cython line-tracing hooks embedded at build time are picked up by
`coverage.py`.
- A clear `UserWarning` is raised if `coverage` or `Cython` are not
installed, with instructions to install them.
**`python/.coveragerc`**
- Added `source`, `branch`, `report` and `html` sections so `coverage.py`
knows which files to measure and where to write the report.
### How to use
```bash
# Build pyarrow with Cython line tracing enabled
PYARROW_GENERATE_COVERAGE=1 pip install -e python/
# Run tests with coverage
cd python
PYARROW_GENERATE_COVERAGE=1 coverage run -m pytest pyarrow/tests/ -x -q
# View report
coverage report
coverage html
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]