Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow tests that perform remote data access to be disabled #401

Merged
merged 10 commits into from
Nov 29, 2018

Conversation

drdavella
Copy link
Contributor

This makes use of the pytest-remotedata plugin in order to control tests that require access to remote data. By default all tests will run, including those that access remote data. To disable this, pass --remote-data=none to the pytest command.

This means that pytest-remotedata is now a test dependency.

This resolves #399. cc @olebole

Copy link
Member

@olebole olebole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still one remote access in docs/index.rst:

045     >>> from astropy.io import fits
046     >>> from astropy import units as u
047     >>> import numpy as np
048     >>> from matplotlib import pyplot as plt
049     >>> from astropy.visualization import quantity_support
050     >>> quantity_support()  # for getting units on the axes below  # doctest: +IGNORE_OUTPUT
051 
052     Now we load the dataset from it's canonical source:
053 
054     >>> f = fits.open('https://dr14.sdss.org/optical/spectrum/view/data/format=fits/spec=lite?plateid=1323&mjd=5279
UNEXPECTED EXCEPTION: URLError(gaierror(-3, 'Temporary failure in name resolution'),)
T

@drdavella drdavella force-pushed the disable-remote-data branch 3 times, most recently from fd5ca40 to d5396cf Compare November 27, 2018 15:56
Copy link
Contributor

@SaOgaz SaOgaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm that this ran correctly for me locally.

@drdavella
Copy link
Contributor Author

@olebole do you have a chance to test this again?

@olebole
Copy link
Member

olebole commented Nov 29, 2018

Yes, I can confirm it works for me. Thank you for the fix.

Copy link
Member

@olebole olebole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me.

@SaOgaz SaOgaz merged commit c2f774b into astropy:master Nov 29, 2018
@drdavella drdavella deleted the disable-remote-data branch November 29, 2018 16:34
@drdavella drdavella restored the disable-remote-data branch November 29, 2018 16:43
@drdavella drdavella deleted the disable-remote-data branch November 29, 2018 16:45
SaOgaz pushed a commit that referenced this pull request Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.6: Tests fail when run without internet access
3 participants