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

Skip tests which use network #9

Open
jayvdb opened this issue Mar 18, 2019 · 3 comments
Open

Skip tests which use network #9

jayvdb opened this issue Mar 18, 2019 · 3 comments

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Mar 18, 2019

Currently this plugin, and all I've found like it, fail when the network is accessed.

It would be nice to have an option to instead skip the test.

The use case is RPM packaging, where the tests are run in an offline VM, and any tests which use the network are going to fail due to connection failures. Sometimes the cause of the error is not obvious.

Enter nose-detecthttp or similar and at least the cause of the error is clear.

The usual procedure is to then disable all of those tests, either with a patch (e.g. adding @pytest.mark.rpmfail to each of them).

If they automatically skipped, the tests can be run without customisation, except for runner flags to enable nose-detecthttp and this new mode.

Current example is pipenv , https://github.com/pypa/pipenv , which I am packaging at https://build.opensuse.org/package/show/home:jayvdb:coala:python3-bears/python-pipenv , and it provides a fake pypi server as a fixture, but some of the tests seem to be slipping through to the real pypi server, but verifying this would require adding a patch to enable HTTPConnection debug logging.

@jayvdb
Copy link
Contributor Author

jayvdb commented Mar 18, 2019

Turns out it would be useless for pipenv, as all the network voodoo is happening in subprocesses, but I regularly encounter less complicated ones where this would be useful.

@jayvdb
Copy link
Contributor Author

jayvdb commented Apr 1, 2019

I raised kevin1024/vcrpy#425 to see if they are interested in catching this.

@simon-weber
Copy link
Contributor

I'd imagine skipping instead of failing would be relatively straightforward, but the plugin does some kind of wonky stuff to get the output it does. My guess is there's a skips equivalent here.

I don't think I'll have time to look into it myself, but feel free to send a PR.

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

2 participants