astropy / astropy/regions

Add test for PixelRegion MPL plot

Open
#211 2 comments 0 reactions 0 assignees View on GitHub
plotting testing
Dominant language
Python
Stars
65
Forks
64
Avg merge
2d 13h
Merged PRs (30d)
4

Description

This plot code is untested:
https://coveralls.io/builds/18587542/source?filename=regions%2Fcore%2Fcore.py#L311

@sushobhana - It looks like you added two months ago.

Can you please add a test that executes it once?

I know that testing plotting code is hard, but a test that executes this code once is helpful even if it doesn't have any asserts, because frequently we find that code in the regions package or MPL or something else changes, and things break without us noticing. So just executing makes sure that no errors or warnings are raised. You could leave a `#TODO: add asserts on output` on the last line if you want to be nice to future maintainers.

You're probably aware, but you can get the coverage locally for any tests / files you like, in this case I would use
```
pip install pytest-cov
pytest -v --cov-report=html --cov=regions.core.core regions/core
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the PixelRegion plotting code in regions/core/core.py at the linked coverage location, then inspect the existing tests under regions/core. Add a test that executes the MPL plot once without errors or warnings, and run pytest -v --cov-report=html --cov=regions.core.core regions/core to confirm the code is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, python
Domain
data-visualization, testing
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.