Refactor _escape_triage.py: split concerns and register pytest hooks explicitly
- Dominant language
- Python
- Stars
- 93
- Forks
- 92
- Avg merge
- 14h 44m
- Merged PRs (30d)
- 30
Description
Follow-up from PR #942 (review items R1/R2, https://github.com/astropy/ccdproc/pull/942#pullrequestreview-4695447403). Lowest priority of the follow-ups — pure internal cleanup, no behavior change.
`ccdproc/tests/_escape_triage.py` currently mixes three separable concerns:
1. failure-triage grouping (collapse backend test failures by escape site),
2. the live escape-log tally fed by the logger, and
3. baseline load/write/enforce (the ratchet),
while the `np.asarray`/`np.asanyarray`/`np.ma.asanyarray` monkeypatching itself lives in `ccdproc/conftest.py`.
Suggested refactor:
- Split into e.g. `_escape_log.py` (logger + tally) and `_escape_ratchet.py` (baseline load/write/enforce), keeping the failure-triage summary where it fits best.
- Register the pytest hooks via `pytest_plugins = ["ccdproc.tests..."]` in `conftest.py` instead of the current load-bearing `# noqa: F401` hook imports.
Contributor guide
Research direction
Start by reading ccdproc/tests/_escape_triage.py and ccdproc/conftest.py, focusing on the logger, tally, ratchet, triage summary, monkeypatching, and current hook imports. Separate the concerns into the proposed modules where appropriate, register pytest hooks through pytest_plugins, and verify that behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100