-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Tests using internet but not declared as such #3630
Comments
Thanks for reporting this, it would be great to improve our test suites and PRs are welcomed. |
Another five pipenv failures when offline documented at sarugaku/requirementslib#152 |
If so, that feels a bit like a bug actually, as the venv's pipenv has been told to use an alternative pypi index, and so pip inside of the venv "should" be using the same index. I believe that is possible by setting envvars. I'll let others chew on that, or toss it out if it is silly. I guess But I do not understand why It fails at this assert c = p.pipenv('install')
assert c.return_code == 0 I've tried changing the package being installed, e.g. to tablib, and it doesnt appear to make any difference. |
As an aside, it would be nice to have an automated way of ensuring the internet marker is added, e.g. a job with internet disabled and using the internet marker to skip properly declared tests. However it doesnt seem to be possible atm using pytest voodoo. e.g. miketheman/pytest-socket#25 and kevin1024/vcrpy#425 Probably needs to be done at the OS level. e.g. a sudo job with resolv.conf edited during the test run. |
|
It appears the tests affected by this issue fall into two categories: they either directly specify a 'url' or 'git' value in a custom Pipfile, or they call 'pip' directly. By my estimation, the tests that match one of those scenarios but are missing a
I'm not sure the easiest way for me to confirm that these tests are indeed all reaching out to the internet when they run. |
@jayvdb I would recommend filing separate individual issues for the following:
|
Fix #3630 Adapt test cases to prefer the mocked PyPI.
I am packaging pipenv for openSUSE, which means the tests must run without internet.
For the most part the internet detection and skipping works great, however I believe the following use the internet without having the
internet
marker.test_download_file
test_pipenv_clean_pip_no_warnings
test_environment_variable_value_does_not_change_hash
test_run_in_virtualenv
test_lock_with_incomplete_source
Only the first is in unit tests, and it is very clearly intentionally needing to use internet. If the internet marker isnt suitable for unit tests, perhaps a simple requests mock would be sufficient?
The others are integration tests, and it is a bit harder to verify these are supposed to be using the internet, as they should probably be intercepted by pytest_pypi.
Also while on the subject, it would be worth skipping
test_system_and_deploy_work
if the location of system packages isnt writable, otherwise that also fails during rpmbuild as it tries to uninstall build dependencies such ascertifi
and fails with :The text was updated successfully, but these errors were encountered: