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

Isolation issues in tests/functional/test_help.py #5957

Closed
cytolentino opened this issue Oct 28, 2018 · 3 comments
Closed

Isolation issues in tests/functional/test_help.py #5957

cytolentino opened this issue Oct 28, 2018 · 3 comments
Labels
auto-locked Outdated issues that have been locked by automation C: tests Testing and related things type: bug A confirmed bug or unintended behavior

Comments

@cytolentino
Copy link
Contributor

Environment

  • pip version: 18.1
  • OS: Mac OS High Sierra 10.13.6

Description

When running tox -e py36, test_help_commands_equally_functional in tests/functional/test_help.py fails because of the following

E             -                 https://pypi.org/simple). This should point to a
E             +                 https://pypi.python.org/simple). This should
E             -   --timeout <sec>             Set the socket timeout (default 15 seconds).
E             ?                                                               ^^
E             +   --timeout <sec>             Set the socket timeout (default 23.0 seconds).

which is caused by my PIP_INDEX_URL being set as follows:

$ echo $PIP_INDEX_URL
https://pypi.python.org/simple

and my pip.conf being set as follows:

$ cat ~/.pip/pip.conf
[global]
timeout = 23

How to Reproduce

  1. Set timeout in pip.conf to some value != 15
  2. Set PIP_INDEX_URL environment variable to something other than https://pypi.org/simple
  3. Run tox -e py36 tests/functional/test_help.py -vv
@cytolentino
Copy link
Contributor Author

Because of user_dir in here being declared before anything else, expanduser returns the user's $HOME despite os.environ['HOME'] being set to a temporary directory here.

Thus, the isolate test fixture (see here) does not manage to prevent the test suite from reading the user's config files.

@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label Dec 14, 2018
@chrahunt chrahunt added C: tests Testing and related things type: bug A confirmed bug or unintended behavior labels Jul 14, 2019
@triage-new-issues triage-new-issues bot removed S: needs triage Issues/PRs that need to be triaged labels Jul 14, 2019
@chrahunt
Copy link
Member

I was able to reproduce this with the provided instructions. I think in general it's probably a good idea to recompute the values in locations that may be context/environment-dependent. That will also help #4497 since it can enable more in-memory tests.

@xavfernandez
Copy link
Member

#6736 fixed this.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Aug 19, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: tests Testing and related things type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants