astropy / pytest-remotedata

Pytest plugin to control whether tests are run that have remote data
BSD 3-Clause "New" or "Revised" License
23 stars 15 forks source link

Add a remote data only option #43

Closed bsipocz closed 2 years ago

bsipocz commented 5 years ago

In several use-cases it would be nice to be able to run the remote_data tests only.

For an earlier approach see #21

jdavies-st commented 2 years ago

The ability to run only tests with a particular marker is built into pytest. To run all tests, including those with remote data using this plugin, we usually do

pytest --remote-data

to run only tests with the @pytest.mark.remote_data marker:

pytest --remote-data -m remote_data

This is a general feature of pytest markers. See

https://docs.pytest.org/en/latest/example/markers.html

bsipocz commented 2 years ago

TIL, thank you so much @jdavies-st!

I suppose this wouldn't hurt to add to the docs here and in astroquery. I keep this issue open until that happens (I'll add it once I'm back from travelling unless someone is quicker).