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 to skip test cases that download data #83

Closed
mbanck opened this issue Jul 20, 2019 · 4 comments
Closed

Allow to skip test cases that download data #83

mbanck opened this issue Jul 20, 2019 · 4 comments

Comments

@mbanck
Copy link

mbanck commented Jul 20, 2019

Some build environments (like Ubuntu autobuilders) have internet firewalled off to ensure that the build process is self-contained. In cases like this, quite a few test cases seem to fail because they try to download stuff.

So it would be convenient if there was an option or switch to skip those tests.

@loriab
Copy link
Collaborator

loriab commented Jul 20, 2019

I suppose that'll be the pubchem tests. Should be easy enough.

@mbanck
Copy link
Author

mbanck commented Jul 20, 2019

whoa, do you ever sleep?? I've made the Debian such that it ignores test failures for now but sure would be nice to be able to run tests cleanly.

@dgasmith
Copy link
Collaborator

dgasmith commented Jul 21, 2019

New testing decorator of:

import socket

def internet_connection():
    try:
        socket.create_connection(("www.google.com", 80))
        return True
    except OSError:
        return False

using_web = pytest.mark.skipif(internet_connection() is False, reason="Could not connect to the internet")

@loriab Can you grab this? Currently my dev env is in a fragile state trying to propagate the Array changes.

@mbanck
Copy link
Author

mbanck commented Jan 10, 2021

sorry, I never tested that back then; I've now checked that the pytests pass fine on my notebook (once I install certifi), but on the Debian autobuilders (which disable networking) they still fail:

https://buildd.debian.org/status/fetch.php?pkg=qcelemental&arch=all&ver=0.17.0%2Bdfsg-2&stamp=1610282048&raw=0

E.g.:

>               raise URLError(err)
E               urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

/usr/lib/python3.9/urllib/request.py:1345: URLError

Is this expected, or have there been some regressions since a4ebcca got committed?

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

No branches or pull requests

3 participants