pypa / pip

The Python package installer
https://pip.pypa.io/
MIT License
9.52k stars 3.03k forks source link

Tests fail when executing test_install_user.py locally #7785

Open ritiek opened 4 years ago

ritiek commented 4 years ago

Environment

Description

Locally executing tests in tests/functional/test_install_user.py returns failures.

Expected behavior

All tests should pass.

How to Reproduce

  1. Download the latest source tree (35181cdf01e1432e9949a95d526597b80ac510c9).
  2. Execute $ tox -e py36 -- tests/functional/test_install_user.py.

(the same tests also fail when executing the complete test suite)

Output

$ tox -e py36 -- -v tests/functional/test_install_user.py ```bash $ tox -e py36 -- -v tests/functional/test_install_user.py    master  GLOB sdist-make: /home/ritiek/Downloads/pip/setup.py py36 inst-nodeps: /home/ritiek/Downloads/pip/.tox/.tmp/package/1/pip-20.1.dev0.zip py36 installed: apipkg==1.5,atomicwrites==1.3.0,attrs==19.3.0,cffi==1.14.0,coverage==5.0.3,cryptography==2.8,csv23==0.1.6,execnet==1.7.1,freezegun==0.3.15,importlib-metadata==1.5.0,mock==4.0.1,more-itertools==8.2.0,pip==20.1.dev0,pluggy==0.13.1,pretend==1.0.9,py==1.8.1,pycparser==2.19,pytest==3.8.2,pytest-cov==2.8.1,pytest-forked==1.1.3,pytest-rerunfailures==6.0,pytest-timeout==1.3.4,pytest-xdist==1.27.0,python-dateutil==2.8.1,PyYAML==5.3,scripttest==1.3,setuptools==40.8.0,six==1.14.0,virtualenv==16.7.10,Werkzeug==0.16.0,wheel==0.33.1,zipp==3.0.0 py36 run-test-pre: PYTHONHASHSEED='977510171' py36 run-test-pre: commands[0] | python -c 'import shutil, sys; shutil.rmtree(sys.argv[1], ignore_errors=True)' /home/ritiek/Downloads/pip/tests/data/common_wheels py36 run-test-pre: commands[1] | python /home/ritiek/Downloads/pip/tools/tox_pip.py wheel -w /home/ritiek/Downloads/pip/tests/data/common_wheels -r /home/ritiek/Downloads/pip/tools/requirements/tests-common_wheels.txt Collecting setuptools>=40.8.0 File was already downloaded /home/ritiek/Downloads/pip/tests/data/common_wheels/setuptools-45.2.0-py3-none-any.whl Collecting wheel File was already downloaded /home/ritiek/Downloads/pip/tests/data/common_wheels/wheel-0.34.2-py2.py3-none-any.whl Skipping setuptools, due to already being wheel. Skipping wheel, due to already being wheel. py36 run-test: commands[0] | pytest --timeout 300 -v tests/functional/test_install_user.py ============================================================================================================= test session starts ============================================================================================================= platform linux -- Python 3.6.9, pytest-3.8.2, py-1.8.1, pluggy-0.13.1 -- /home/ritiek/Downloads/pip/.tox/py36/bin/python cachedir: .pytest_cache rootdir: /home/ritiek/Downloads/pip, inifile: setup.cfg plugins: rerunfailures-6.0, timeout-1.3.4, xdist-1.27.0, cov-2.8.1, forked-1.1.3 timeout: 300.0s timeout method: signal timeout func_only: False collected 9 items tests/functional/test_install_user.py::Tests_UserSite::test_reset_env_system_site_packages_usersite PASSED [ 11%] tests/functional/test_install_user.py::Tests_UserSite::test_install_subversion_usersite_editable_with_distribute SKIPPED [ 22%] tests/functional/test_install_user.py::Tests_UserSite::test_install_from_current_directory_into_usersite PASSED [ 33%] tests/functional/test_install_user.py::Tests_UserSite::test_install_user_venv_nositepkgs_fails PASSED [ 44%] tests/functional/test_install_user.py::Tests_UserSite::test_install_user_conflict_in_usersite PASSED [ 55%] tests/functional/test_install_user.py::Tests_UserSite::test_install_user_conflict_in_globalsite FAILED [ 66%] tests/functional/test_install_user.py::Tests_UserSite::test_upgrade_user_conflict_in_globalsite PASSED [ 77%] tests/functional/test_install_user.py::Tests_UserSite::test_install_user_conflict_in_globalsite_and_usersite FAILED [ 88%] tests/functional/test_install_user.py::Tests_UserSite::test_install_user_in_global_virtualenv_with_conflict_fails PASSED [100%] ================================================================================================================== FAILURES =================================================================================================================== ___________________________________________________________________________________________ Tests_UserSite.test_install_user_conflict_in_globalsite ___________________________________________________________________________________________ self = , virtualenv = script = @pytest.mark.network @pytest.mark.incompatible_with_test_venv def test_install_user_conflict_in_globalsite(self, virtualenv, script): """ Test user install with conflict in global site ignores site and installs to usersite """ _patch_dist_in_site_packages(virtualenv) script.pip('install', 'INITools==0.2', '--no-binary=:all:') result2 = script.pip( > 'install', '--user', 'INITools==0.1', '--no-binary=:all:') tests/functional/test_install_user.py:135: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , args = ('python', '-m', 'pip', 'install', '--user', 'INITools==0.1', ...), kw = {'expect_stderr': True} cwd = Path('/tmp/pytest-of-ritiek/pytest-27/test_install_user_conflict_in_0/workspace/scratch'), run_from = None, allow_stderr_error = False, allow_stderr_warning = False, expect_error = None def run(self, *args, **kw): """ :param allow_stderr_error: whether a logged error is allowed in stderr. Passing True for this argument implies `allow_stderr_warning` since warnings are weaker than errors. :param allow_stderr_warning: whether a logged warning (or deprecation message) is allowed in stderr. :param expect_error: if False (the default), asserts that the command exits with 0. Otherwise, asserts that the command exits with a non-zero exit code. Passing True also implies allow_stderr_error and allow_stderr_warning. :param expect_stderr: whether to allow warnings in stderr (equivalent to `allow_stderr_warning`). This argument is an abbreviated version of `allow_stderr_warning` and is also kept for backwards compatibility. """ if self.verbose: print('>> running %s %s' % (args, kw)) cwd = kw.pop('cwd', None) run_from = kw.pop('run_from', None) assert not cwd or not run_from, "Don't use run_from; it's going away" cwd = cwd or run_from or self.cwd if sys.platform == 'win32': # Partial fix for ScriptTest.run using `shell=True` on Windows. args = [str(a).replace('^', '^^').replace('&', '^&') for a in args] # Remove `allow_stderr_error` and `allow_stderr_warning` before # calling run() because PipTestEnvironment doesn't support them. allow_stderr_error = kw.pop('allow_stderr_error', None) allow_stderr_warning = kw.pop('allow_stderr_warning', None) # Propagate default values. expect_error = kw.get('expect_error') if expect_error: # Then default to allowing logged errors. if allow_stderr_error is not None and not allow_stderr_error: raise RuntimeError( 'cannot pass allow_stderr_error=False with ' 'expect_error=True' ) allow_stderr_error = True elif kw.get('expect_stderr'): # Then default to allowing logged warnings. if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'expect_stderr=True' ) allow_stderr_warning = True if allow_stderr_error: if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'allow_stderr_error=True' ) # Default values if not set. if allow_stderr_error is None: allow_stderr_error = False if allow_stderr_warning is None: allow_stderr_warning = allow_stderr_error # Pass expect_stderr=True to allow any stderr. We do this because # we do our checking of stderr further on in check_stderr(). kw['expect_stderr'] = True > result = super(PipTestEnvironment, self).run(cwd=cwd, *args, **kw) E AssertionError: Script returned code: 1 tests/lib/__init__.py:591: AssertionError ------------------------------------------------------------------------------------------------------------ Captured stdout call ------------------------------------------------------------------------------------------------------------- Script result: python -m pip install --user INITools==0.1 --no-binary=:all: return code: 1 -- stderr: -------------------- ERROR: Will not install to the user site because it will lack sys.path precedence to INITools in /tmp/pytest-of-ritiek/pytest-27/test_install_user_conflict_in_0/workspace/venv/lib/python3.6/site-packages ____________________________________________________________________________________ Tests_UserSite.test_install_user_conflict_in_globalsite_and_usersite _____________________________________________________________________________________ self = , virtualenv = script = @pytest.mark.network @pytest.mark.incompatible_with_test_venv def test_install_user_conflict_in_globalsite_and_usersite( self, virtualenv, script): """ Test user install with conflict in globalsite and usersite ignores global site and updates usersite. """ _patch_dist_in_site_packages(virtualenv) script.pip('install', 'INITools==0.2', '--no-binary=:all:') > script.pip('install', '--user', 'INITools==0.3', '--no-binary=:all:') tests/functional/test_install_user.py:195: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , args = ('python', '-m', 'pip', 'install', '--user', 'INITools==0.3', ...), kw = {'expect_stderr': True} cwd = Path('/tmp/pytest-of-ritiek/pytest-27/test_install_user_conflict_in_0/workspace/scratch'), run_from = None, allow_stderr_error = False, allow_stderr_warning = False, expect_error = None def run(self, *args, **kw): """ :param allow_stderr_error: whether a logged error is allowed in stderr. Passing True for this argument implies `allow_stderr_warning` since warnings are weaker than errors. :param allow_stderr_warning: whether a logged warning (or deprecation message) is allowed in stderr. :param expect_error: if False (the default), asserts that the command exits with 0. Otherwise, asserts that the command exits with a non-zero exit code. Passing True also implies allow_stderr_error and allow_stderr_warning. :param expect_stderr: whether to allow warnings in stderr (equivalent to `allow_stderr_warning`). This argument is an abbreviated version of `allow_stderr_warning` and is also kept for backwards compatibility. """ if self.verbose: print('>> running %s %s' % (args, kw)) cwd = kw.pop('cwd', None) run_from = kw.pop('run_from', None) assert not cwd or not run_from, "Don't use run_from; it's going away" cwd = cwd or run_from or self.cwd if sys.platform == 'win32': # Partial fix for ScriptTest.run using `shell=True` on Windows. args = [str(a).replace('^', '^^').replace('&', '^&') for a in args] # Remove `allow_stderr_error` and `allow_stderr_warning` before # calling run() because PipTestEnvironment doesn't support them. allow_stderr_error = kw.pop('allow_stderr_error', None) allow_stderr_warning = kw.pop('allow_stderr_warning', None) # Propagate default values. expect_error = kw.get('expect_error') if expect_error: # Then default to allowing logged errors. if allow_stderr_error is not None and not allow_stderr_error: raise RuntimeError( 'cannot pass allow_stderr_error=False with ' 'expect_error=True' ) allow_stderr_error = True elif kw.get('expect_stderr'): # Then default to allowing logged warnings. if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'expect_stderr=True' ) allow_stderr_warning = True if allow_stderr_error: if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'allow_stderr_error=True' ) # Default values if not set. if allow_stderr_error is None: allow_stderr_error = False if allow_stderr_warning is None: allow_stderr_warning = allow_stderr_error # Pass expect_stderr=True to allow any stderr. We do this because # we do our checking of stderr further on in check_stderr(). kw['expect_stderr'] = True > result = super(PipTestEnvironment, self).run(cwd=cwd, *args, **kw) E AssertionError: Script returned code: 1 tests/lib/__init__.py:591: AssertionError ------------------------------------------------------------------------------------------------------------ Captured stdout call ------------------------------------------------------------------------------------------------------------- Script result: python -m pip install --user INITools==0.3 --no-binary=:all: return code: 1 -- stderr: -------------------- ERROR: Will not install to the user site because it will lack sys.path precedence to INITools in /tmp/pytest-of-ritiek/pytest-27/test_install_user_conflict_in_0/workspace/venv/lib/python3.6/site-packages =========================================================================================================== short test summary info =========================================================================================================== FAIL tests/functional/test_install_user.py::Tests_UserSite::()::test_install_user_conflict_in_globalsite FAIL tests/functional/test_install_user.py::Tests_UserSite::()::test_install_user_conflict_in_globalsite_and_usersite SKIP [1] tests/functional/test_install_user.py:44: Subversion is not available =============================================================================================== 2 failed, 6 passed, 1 skipped in 29.47 seconds ================================================================================================ ERROR: InvocationError for command /home/ritiek/Downloads/pip/.tox/py36/bin/pytest --timeout 300 -v tests/functional/test_install_user.py (exited with code 1) ___________________________________________________________________________________________________________________ summary ___________________________________________________________________________________________________________________ ERROR: py36: commands failed ```

I thought it's because I didn't execute the test as root (guessing from the failing test name test_install_user_conflict_in_globalsite) but executing as root causes the same failures.

uranusjr commented 4 years ago

Is your Tox installed with virtualenv>=20? There are a few tests (especially those marked with incompatible_with_test_venv that can have this problem.

ritiek commented 4 years ago

No, I didn't install tox or pytest under virtualenv and above failures are not in a virtualenv either. I installed these packages for my current user with:

$ pip3 install tox pytest --user

I am able to reproduce the above test failures even if I uninstall virtualenv (both user and system-wide packages).

If I run the tests by passing --use-venv as pytest args (with even installing virtualenv), that is:

$ tox -e py36 -- tests/functional/test_install_user.py --use-venv

then the above failing tests are skipped (probably due to them being marked with incompatible_with_test_venv).

uranusjr commented 4 years ago

Tox has a dependency on virtualenv; I meant to ask whether you’re using virtualenv>=20 to satisfy that dependency, not whether you installed tox inside a virtual environment. Sorry if my wording was causing misunderstandings.

You can find out the version of virtualenv tox is depending on with pip3 list. Try pip3 install "virtualenv<20" and run tox again to see whether this fixes the problem.

ritiek commented 4 years ago

I see but it's still weird. Those tests still fail with virtualenv<20.

$ pip3 list | grep -e tox -e virtualenv
tox                   3.14.5                                                      
virtualenv            16.7.10

I also had virtualenv v16.7.10 installed in the log as of my original post:

py36 installed: apipkg==1.5,atomicwrites==1.3.0,attrs==19.3.0,cffi==1.14.0,coverage==5.0.3,cryptography==2.8,csv23==0.1.6,execnet==1.7.1,freezegun==0.3.15,importlib-metadata==1.5.0,mock==4.0.1,more-itertools==8.2.0,pip==20.1.dev0,pluggy==0.13.1,pretend==1.0.9,py==1.8.1,pycparser==2.19,pytest==3.8.2,pytest-cov==2.8.1,pytest-forked==1.1.3,pytest-rerunfailures==6.0,pytest-timeout==1.3.4,pytest-xdist==1.27.0,python-dateutil==2.8.1,PyYAML==5.3,scripttest==1.3,setuptools==40.8.0,six==1.14.0,virtualenv==16.7.10,Werkzeug==0.16.0,wheel==0.33.1,zipp==3.0.0

I also tried deleting .tox cache directory (which gets generated upon running tests), checking virtualenv version and re-running tox but still no luck.

ritiek commented 4 years ago

I'll see if I can figure this out tonight.

pradyunsg commented 4 years ago

Could you share the output of tox -e py36 --notest?

ritiek commented 4 years ago

Yep, sure. Here you go:

$ tox -e py36 --notest                                                                                                                                                                             master 
GLOB sdist-make: /home/ritiek/Downloads/pip/setup.py
py36 inst-nodeps: /home/ritiek/Downloads/pip/.tox/.tmp/package/1/pip-20.1.dev0.zip
py36 installed: apipkg==1.5,atomicwrites==1.3.0,attrs==19.3.0,cffi==1.14.0,coverage==5.0.3,cryptography==2.8,csv23==0.1.6,execnet==1.7.1,freezegun==0.3.15,importlib-metadata==1.5.0,mock==4.0.1,more-itertools==8.2.0,pip==20.1.dev0,pluggy==0.13.1,pretend==1.0.9,py==1.8.1,pycparser==2.19,pytest==3.8.2,pytest-cov==2.8.1,pytest-forked==1.1.3,pytest-rerunfailures==6.0,pytest-timeout==1.3.4,pytest-xdist==1.27.0,python-dateutil==2.8.1,PyYAML==5.3,scripttest==1.3,setuptools==42.0.2,six==1.14.0,virtualenv==16.7.10,Werkzeug==0.16.0,wheel==0.33.6,zipp==3.0.0
___________________________________________________________________________________________________________________ summary ___________________________________________________________________________________________________________________
  py36: skipped tests
  congratulations :)
ritiek commented 4 years ago

The tests seem to failing cuz of this error (see log):

-- stderr: -------------------- ERROR: Will not install to the user site because it will lack sys.path precedence to INITools in /tmp/pytest-of-ritiek/pytest-27/test_install_user_conflict_in_0/workspace/venv/lib/python3.6/site-packages

This error can also reproduced using virtualenv, like so:

$ virtualenv --version
16.7.10
$ virtualenv env --system-site-packages
$ pip install requests==2.20.0

$ pip install requests==2.20.1 --user
ERROR: Will not install to the user site because it will lack sys.path precedence to requests in /home/ritiek/Downloads/pip/env/lib/python3.6/site-packages

Is this error expected here?

Because I think a similar thing happens (in line 132 and 134) in the failing test: https://github.com/pypa/pip/blob/5b442d503a6c1bd0d7349c50aa2d72f17340a016/tests/functional/test_install_user.py#L123-L152

I'm kinda confused here. Since this test is marked with @pytest.mark.incompatible_with_test_venv which makes it so it is skipped when --use-venv is passed to pytest args. But even when this arg isn't passed to pytest, the function definition still accepts pytest's virtualenv parameter (which then probably causes the error as reproduced above).

However, if this is really the case (that this test runs in virtualenv even when --use-venv isn't passed) then I'm not sure why these tests pass on CI either..

jku commented 4 years ago

For what it's worth I see the same thing in 6 tests:

FAILED tests/functional/test_install_user.py::Tests_UserSite::test_install_user_conflict_in_globalsite
FAILED tests/functional/test_install_user.py::Tests_UserSite::test_install_user_conflict_in_globalsite_and_usersite
FAILED tests/functional/test_new_resolver_user.py::test_new_resolver_install_user_reinstall_global_site
FAILED tests/functional/test_new_resolver_user.py::test_new_resolver_install_user_conflict_in_global_site
FAILED tests/functional/test_new_resolver_user.py::test_new_resolver_install_user_conflict_in_global_and_user_sites
FAILED tests/functional/test_uninstall_user.py::Tests_UninstallUserSite::test_uninstall_from_usersite_with_dist_in_global_site

This is on debian unstable, python 3.8, virtualenv 16.7.10, pip git master. It seems like the virtualenv.sitecustomize trick in _patch_dist_in_site_packages() is not doing what it's supposed to do: the sitecustomize.py file appears where it should but ... it's like it's never imported?

tox -e py38 -- -n auto ``` jku@luna:~/src/pip$ tox -e py38 -- -n auto GLOB sdist-make: /home/jku/src/pip/setup.py py38 inst-nodeps: /home/jku/src/pip/.tox/.tmp/package/1/pip-20.2.dev1.zip py38 installed: apipkg==1.5,atomicwrites==1.4.0,attrs==19.3.0,cffi==1.14.0,coverage==5.1,cryptography==2.8,csv23==0.3.2,execnet==1.7.1,freezegun==0.3.15,mock==4.0.2,more-itertools==8.4.0,packaging==20.4,pip @ file:///home/jku/src/pip/.tox/.tmp/package/1/pip-20.2.dev1.zip,pluggy==0.13.1,pretend==1.0.9,py==1.8.2,pycparser==2.20,pyparsing==2.4.7,pytest==4.6.11,pytest-cov==2.10.0,pytest-forked==1.1.3,pytest-rerunfailures==8.0,pytest-timeout==1.4.0,pytest-xdist==1.32.0,python-dateutil==2.8.1,PyYAML==5.3.1,scripttest==1.3,setuptools==42.0.2,six==1.15.0,virtualenv @ https://github.com/pypa/virtualenv/archive/legacy.zip,wcwidth==0.2.4,Werkzeug==0.16.0,wheel==0.33.6 py38 run-test-pre: PYTHONHASHSEED='2612471228' py38 run-test-pre: commands[0] | python -c 'import shutil, sys; shutil.rmtree(sys.argv[1], ignore_errors=True)' /home/jku/src/pip/tests/data/common_wheels py38 run-test-pre: commands[1] | python /home/jku/src/pip/tools/tox_pip.py wheel -w /home/jku/src/pip/tests/data/common_wheels -r /home/jku/src/pip/tools/requirements/tests-common_wheels.txt Collecting setuptools>=40.8.0 Using cached setuptools-47.3.0-py3-none-any.whl (583 kB) Saved ./tests/data/common_wheels/setuptools-47.3.0-py3-none-any.whl Collecting wheel Using cached wheel-0.34.2-py2.py3-none-any.whl (26 kB) Saved ./tests/data/common_wheels/wheel-0.34.2-py2.py3-none-any.whl Skipping setuptools, due to already being wheel. Skipping wheel, due to already being wheel. py38 run-test: commands[0] | pytest --timeout 300 -W ignore::UserWarning -n auto ===================================== test session starts ===================================== platform linux -- Python 3.8.3, pytest-4.6.11, py-1.8.2, pluggy-0.13.1 cachedir: .tox/py38/.pytest_cache rootdir: /home/jku/src/pip, inifile: setup.cfg plugins: timeout-1.4.0, rerunfailures-8.0, xdist-1.32.0, cov-2.10.0, forked-1.1.3 timeout: 300.0s timeout method: signal timeout func_only: False gw0 ok / gw1 C / gw2 C / gw3 C / gw4 C / gw5 C / gw6 C / gw7 C / gw8 C / gw9 C / gw10 C / gw11 gw0 ok / gw1 ok / gw2 C / gw3 C / gw4 C / gw5 C / gw6 C / gw7 C / gw8 C / gw9 C / gw10 C / gw11gw0 ok / gw1 ok / gw2 ok / gw3 C / gw4 C / gw5 C / gw6 C / gw7 C / gw8 C / gw9 C / gw10 C / gw1gw0 ok / gw1 ok / gw2 ok / gw3 ok / gw4 C / gw5 C / gw6 C / gw7 C / gw8 C / gw9 C / gw10 C / gwgw0 ok / gw1 ok / gw2 ok / gw3 ok / gw4 ok / gw5 C / gw6 C / gw7 C / gw8 C / gw9 C / gw10 C / ggw0 ok / gw1 ok / gw2 ok / gw3 ok / gw4 ok / gw5 ok / gw6 C / gw7 C / gw8 C / gw9 C / gw10 C / gw0 ok / gw1 ok / gw2 ok / gw3 ok / gw4 ok / gw5 ok / gw6 ok / gw7 C / gw8 C / gw9 C / gw10 C /gw0 ok / gw1 ok / gw2 ok / gw3 ok / gw4 ok / gw5 ok / gw6 ok / gw7 ok / gw8 C / gw9 C / gw10 C gw0 ok / gw1 ok / gw2 ok / gw3 ok / gw4 ok / gw5 ok / gw6 ok / gw7 ok / gw8 ok / gw9 C / gw10 Cgw0 ok / gw1 ok / gw2 ok / gw3 ok / gw4 ok / gw5 ok / gw6 ok / gw7 ok / gw8 ok / gw9 ok / gw10 gw0 ok / gw1 ok / gw2 ok / gw3 ok / gw4 ok / gw5 ok / gw6 ok / gw7 ok / gw8 ok / gw9 ok / gw10 gw0 ok / gw1 ok / gw2 ok / gw3 ok / gw4 ok / gw5 ok / gw6 ok / gw7 ok / gw8 ok / gw9 ok / gw10 gw0 [2014] / gw1 ok / gw2 ok / gw3 ok / gw4 ok / gw5 ok / gw6 ok / gw7 ok / gw8 ok / gw9 ok / ggw0 [2014] / gw1 [2014] / gw2 ok / gw3 ok / gw4 ok / gw5 ok / gw6 ok / gw7 ok / gw8 ok / gw9 okgw0 [2014] / gw1 [2014] / gw2 ok / gw3 ok / gw4 ok / gw5 [2014] / gw6 ok / gw7 ok / gw8 ok / gwgw0 [2014] / gw1 [2014] / gw2 ok / gw3 ok / gw4 [2014] / gw5 [2014] / gw6 ok / gw7 ok / gw8 ok gw0 [2014] / gw1 [2014] / gw2 [2014] / gw3 ok / gw4 [2014] / gw5 [2014] / gw6 ok / gw7 ok / gw8gw0 [2014] / gw1 [2014] / gw2 [2014] / gw3 ok / gw4 [2014] / gw5 [2014] / gw6 [2014] / gw7 ok /gw0 [2014] / gw1 [2014] / gw2 [2014] / gw3 ok / gw4 [2014] / gw5 [2014] / gw6 [2014] / gw7 ok /gw0 [2014] / gw1 [2014] / gw2 [2014] / gw3 ok / gw4 [2014] / gw5 [2014] / gw6 [2014] / gw7 ok /gw0 [2014] / gw1 [2014] / gw2 [2014] / gw3 [2014] / gw4 [2014] / gw5 [2014] / gw6 [2014] / gw7 gw0 [2014] / gw1 [2014] / gw2 [2014] / gw3 [2014] / gw4 [2014] / gw5 [2014] / gw6 [2014] / gw7 gw0 [2014] / gw1 [2014] / gw2 [2014] / gw3 [2014] / gw4 [2014] / gw5 [2014] / gw6 [2014] / gw7 gw0 [2014] / gw1 [2014] / gw2 [2014] / gw3 [2014] / gw4 [2014] / gw5 [2014] / gw6 [2014] / gw7 [2014] / gw8 [2014] / gw9 [2014] / gw10 [2014] / gw11 [2014] ....................................................s.....................s...s......... [ 4%] ......x.............s......s......................s..s.......s...s....s.............s.. [ 8%] ...........................s.........s.....................s........................... [ 13%] ..x.......................................................................s.x....x..... [ 17%] ..x............s..............................................F.F...................... [ 21%] ....................................................................................... [ 25%] .................s............s.s...................................................... [ 30%] .............................................................................s......... [ 34%] ....................ss...........s..................................................... [ 38%] .................................................................................s..... [ 43%] ....................................................................................... [ 47%] ....................................................................................... [ 51%] ......................................................................................s [ 56%] ss....................................................................................... [ 60%] ..........................................................s..........s................. [ 64%] ....................................................................................... [ 69%] ....................................................................................... [ 73%] .............ss......................................................................... [ 77%] ........................................s.............................................. [ 82%] ...................s..................................s................................ [ 86%] ....................................................................................... [ 90%] ..................................................................x............F....... [ 95%] ..............x.........F...F....X...x....x.s..x....X.X...........XXX.XX.s............. [ 99%] ..F.sss.. [100%] ========================================== FAILURES =========================================== ___________________ Tests_UserSite.test_install_user_conflict_in_globalsite ___________________ [gw7] linux -- Python 3.8.3 /home/jku/src/pip/.tox/py38/bin/python self = virtualenv = script = @pytest.mark.network @pytest.mark.incompatible_with_test_venv @pytest.mark.fails_on_new_resolver def test_install_user_conflict_in_globalsite(self, virtualenv, script): """ Test user install with conflict in global site ignores site and installs to usersite """ _patch_dist_in_site_packages(virtualenv) script.pip('install', 'INITools==0.2', '--no-binary=:all:') > result2 = script.pip( 'install', '--user', 'INITools==0.1', '--no-binary=:all:') tests/functional/test_install_user.py:139: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ('python', '-m', 'pip', 'install', '--user', 'INITools==0.1', ...) kw = {'expect_stderr': True} cwd = Path('/tmp/pytest-of-jku/pytest-1/popen-gw7/test_install_user_conflict_in_0/workspace/scratch') run_from = None, allow_stderr_error = False, allow_stderr_warning = False, allow_error = None expect_error = None def run(self, *args, **kw): """ :param allow_stderr_error: whether a logged error is allowed in stderr. Passing True for this argument implies `allow_stderr_warning` since warnings are weaker than errors. :param allow_stderr_warning: whether a logged warning (or deprecation message) is allowed in stderr. :param allow_error: if True (default is False) does not raise exception when the command exit value is non-zero. Implies expect_error, but in contrast to expect_error will not assert that the exit value is zero. :param expect_error: if False (the default), asserts that the command exits with 0. Otherwise, asserts that the command exits with a non-zero exit code. Passing True also implies allow_stderr_error and allow_stderr_warning. :param expect_stderr: whether to allow warnings in stderr (equivalent to `allow_stderr_warning`). This argument is an abbreviated version of `allow_stderr_warning` and is also kept for backwards compatibility. """ if self.verbose: print('>> running {args} {kw}'.format(**locals())) cwd = kw.pop('cwd', None) run_from = kw.pop('run_from', None) assert not cwd or not run_from, "Don't use run_from; it's going away" cwd = cwd or run_from or self.cwd if sys.platform == 'win32': # Partial fix for ScriptTest.run using `shell=True` on Windows. args = [str(a).replace('^', '^^').replace('&', '^&') for a in args] # Remove `allow_stderr_error`, `allow_stderr_warning` and # `allow_error` before calling run() because PipTestEnvironment # doesn't support them. allow_stderr_error = kw.pop('allow_stderr_error', None) allow_stderr_warning = kw.pop('allow_stderr_warning', None) allow_error = kw.pop('allow_error', None) if allow_error: kw['expect_error'] = True # Propagate default values. expect_error = kw.get('expect_error') if expect_error: # Then default to allowing logged errors. if allow_stderr_error is not None and not allow_stderr_error: raise RuntimeError( 'cannot pass allow_stderr_error=False with ' 'expect_error=True' ) allow_stderr_error = True elif kw.get('expect_stderr'): # Then default to allowing logged warnings. if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'expect_stderr=True' ) allow_stderr_warning = True if allow_stderr_error: if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'allow_stderr_error=True' ) # Default values if not set. if allow_stderr_error is None: allow_stderr_error = False if allow_stderr_warning is None: allow_stderr_warning = allow_stderr_error # Pass expect_stderr=True to allow any stderr. We do this because # we do our checking of stderr further on in check_stderr(). kw['expect_stderr'] = True > result = super(PipTestEnvironment, self).run(cwd=cwd, *args, **kw) E AssertionError: Script returned code: 1 tests/lib/__init__.py:628: AssertionError ------------------------------------ Captured stdout call ------------------------------------- Script result: python -m pip install --user INITools==0.1 --no-binary=:all: return code: 1 -- stderr: -------------------- ERROR: Will not install to the user site because it will lack sys.path precedence to INITools in /tmp/pytest-of-jku/pytest-1/popen-gw7/test_install_user_conflict_in_0/workspace/venv/lib/python3.8/site-packages ____________ Tests_UserSite.test_install_user_conflict_in_globalsite_and_usersite _____________ [gw9] linux -- Python 3.8.3 /home/jku/src/pip/.tox/py38/bin/python self = virtualenv = script = @pytest.mark.network @pytest.mark.incompatible_with_test_venv @pytest.mark.fails_on_new_resolver def test_install_user_conflict_in_globalsite_and_usersite( self, virtualenv, script): """ Test user install with conflict in globalsite and usersite ignores global site and updates usersite. """ _patch_dist_in_site_packages(virtualenv) script.pip('install', 'INITools==0.2', '--no-binary=:all:') > script.pip('install', '--user', 'INITools==0.3', '--no-binary=:all:') tests/functional/test_install_user.py:204: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ('python', '-m', 'pip', 'install', '--user', 'INITools==0.3', ...) kw = {'expect_stderr': True} cwd = Path('/tmp/pytest-of-jku/pytest-1/popen-gw9/test_install_user_conflict_in_0/workspace/scratch') run_from = None, allow_stderr_error = False, allow_stderr_warning = False, allow_error = None expect_error = None def run(self, *args, **kw): """ :param allow_stderr_error: whether a logged error is allowed in stderr. Passing True for this argument implies `allow_stderr_warning` since warnings are weaker than errors. :param allow_stderr_warning: whether a logged warning (or deprecation message) is allowed in stderr. :param allow_error: if True (default is False) does not raise exception when the command exit value is non-zero. Implies expect_error, but in contrast to expect_error will not assert that the exit value is zero. :param expect_error: if False (the default), asserts that the command exits with 0. Otherwise, asserts that the command exits with a non-zero exit code. Passing True also implies allow_stderr_error and allow_stderr_warning. :param expect_stderr: whether to allow warnings in stderr (equivalent to `allow_stderr_warning`). This argument is an abbreviated version of `allow_stderr_warning` and is also kept for backwards compatibility. """ if self.verbose: print('>> running {args} {kw}'.format(**locals())) cwd = kw.pop('cwd', None) run_from = kw.pop('run_from', None) assert not cwd or not run_from, "Don't use run_from; it's going away" cwd = cwd or run_from or self.cwd if sys.platform == 'win32': # Partial fix for ScriptTest.run using `shell=True` on Windows. args = [str(a).replace('^', '^^').replace('&', '^&') for a in args] # Remove `allow_stderr_error`, `allow_stderr_warning` and # `allow_error` before calling run() because PipTestEnvironment # doesn't support them. allow_stderr_error = kw.pop('allow_stderr_error', None) allow_stderr_warning = kw.pop('allow_stderr_warning', None) allow_error = kw.pop('allow_error', None) if allow_error: kw['expect_error'] = True # Propagate default values. expect_error = kw.get('expect_error') if expect_error: # Then default to allowing logged errors. if allow_stderr_error is not None and not allow_stderr_error: raise RuntimeError( 'cannot pass allow_stderr_error=False with ' 'expect_error=True' ) allow_stderr_error = True elif kw.get('expect_stderr'): # Then default to allowing logged warnings. if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'expect_stderr=True' ) allow_stderr_warning = True if allow_stderr_error: if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'allow_stderr_error=True' ) # Default values if not set. if allow_stderr_error is None: allow_stderr_error = False if allow_stderr_warning is None: allow_stderr_warning = allow_stderr_error # Pass expect_stderr=True to allow any stderr. We do this because # we do our checking of stderr further on in check_stderr(). kw['expect_stderr'] = True > result = super(PipTestEnvironment, self).run(cwd=cwd, *args, **kw) E AssertionError: Script returned code: 1 tests/lib/__init__.py:628: AssertionError ------------------------------------ Captured stdout call ------------------------------------- Script result: python -m pip install --user INITools==0.3 --no-binary=:all: return code: 1 -- stderr: -------------------- ERROR: Will not install to the user site because it will lack sys.path precedence to INITools in /tmp/pytest-of-jku/pytest-1/popen-gw9/test_install_user_conflict_in_0/workspace/venv/lib/python3.8/site-packages ____________________ test_new_resolver_install_user_reinstall_global_site _____________________ [gw10] linux -- Python 3.8.3 /home/jku/src/pip/.tox/py38/bin/python script = @pytest.mark.incompatible_with_test_venv @pytest.mark.usefixtures("patch_dist_in_site_packages") def test_new_resolver_install_user_reinstall_global_site(script): """ Specifying --force-reinstall makes a different version in user site, ignoring the matching installation in global site. """ create_basic_wheel_for_package(script, "base", "1.0.0") script.pip( "install", "--unstable-feature=resolver", "--no-cache-dir", "--no-index", "--find-links", script.scratch_path, "base==1.0.0", ) > result = script.pip( "install", "--unstable-feature=resolver", "--no-cache-dir", "--no-index", "--find-links", script.scratch_path, "--user", "--force-reinstall", "base==1.0.0", ) tests/functional/test_new_resolver_user.py:136: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ('python', '-m', 'pip', 'install', '--unstable-feature=resolver', '--no-cache-dir', ...) kw = {'expect_stderr': True} cwd = Path('/tmp/pytest-of-jku/pytest-1/popen-gw10/test_new_resolver_install_user0/workspace/scratch') run_from = None, allow_stderr_error = False, allow_stderr_warning = False, allow_error = None expect_error = None def run(self, *args, **kw): """ :param allow_stderr_error: whether a logged error is allowed in stderr. Passing True for this argument implies `allow_stderr_warning` since warnings are weaker than errors. :param allow_stderr_warning: whether a logged warning (or deprecation message) is allowed in stderr. :param allow_error: if True (default is False) does not raise exception when the command exit value is non-zero. Implies expect_error, but in contrast to expect_error will not assert that the exit value is zero. :param expect_error: if False (the default), asserts that the command exits with 0. Otherwise, asserts that the command exits with a non-zero exit code. Passing True also implies allow_stderr_error and allow_stderr_warning. :param expect_stderr: whether to allow warnings in stderr (equivalent to `allow_stderr_warning`). This argument is an abbreviated version of `allow_stderr_warning` and is also kept for backwards compatibility. """ if self.verbose: print('>> running {args} {kw}'.format(**locals())) cwd = kw.pop('cwd', None) run_from = kw.pop('run_from', None) assert not cwd or not run_from, "Don't use run_from; it's going away" cwd = cwd or run_from or self.cwd if sys.platform == 'win32': # Partial fix for ScriptTest.run using `shell=True` on Windows. args = [str(a).replace('^', '^^').replace('&', '^&') for a in args] # Remove `allow_stderr_error`, `allow_stderr_warning` and # `allow_error` before calling run() because PipTestEnvironment # doesn't support them. allow_stderr_error = kw.pop('allow_stderr_error', None) allow_stderr_warning = kw.pop('allow_stderr_warning', None) allow_error = kw.pop('allow_error', None) if allow_error: kw['expect_error'] = True # Propagate default values. expect_error = kw.get('expect_error') if expect_error: # Then default to allowing logged errors. if allow_stderr_error is not None and not allow_stderr_error: raise RuntimeError( 'cannot pass allow_stderr_error=False with ' 'expect_error=True' ) allow_stderr_error = True elif kw.get('expect_stderr'): # Then default to allowing logged warnings. if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'expect_stderr=True' ) allow_stderr_warning = True if allow_stderr_error: if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'allow_stderr_error=True' ) # Default values if not set. if allow_stderr_error is None: allow_stderr_error = False if allow_stderr_warning is None: allow_stderr_warning = allow_stderr_error # Pass expect_stderr=True to allow any stderr. We do this because # we do our checking of stderr further on in check_stderr(). kw['expect_stderr'] = True > result = super(PipTestEnvironment, self).run(cwd=cwd, *args, **kw) E AssertionError: Script returned code: 1 tests/lib/__init__.py:628: AssertionError ------------------------------------ Captured stdout call ------------------------------------- Script result: python -m pip install --unstable-feature=resolver --no-cache-dir --no-index --find-links /tmp/pytest-of-jku/pytest-1/popen-gw10/test_new_resolver_install_user0/workspace/scratch --user --force-reinstall base==1.0.0 return code: 1 -- stderr: -------------------- ERROR: Will not install to the user site because it will lack sys.path precedence to base in /tmp/pytest-of-jku/pytest-1/popen-gw10/test_new_resolver_install_user0/workspace/venv/lib/python3.8/site-packages -- stdout: -------------------- Looking in links: /tmp/pytest-of-jku/pytest-1/popen-gw10/test_new_resolver_install_user0/workspace/scratch Processing ./base-1.0.0-py2.py3-none-any.whl ___________________ test_new_resolver_install_user_conflict_in_global_site ____________________ [gw10] linux -- Python 3.8.3 /home/jku/src/pip/.tox/py38/bin/python script = @pytest.mark.incompatible_with_test_venv @pytest.mark.usefixtures("patch_dist_in_site_packages") def test_new_resolver_install_user_conflict_in_global_site(script): """ Installing a different version in user site should ignore an existing different version in global site, and simply add to the user site. """ create_basic_wheel_for_package(script, "base", "1.0.0") create_basic_wheel_for_package(script, "base", "2.0.0") script.pip( "install", "--unstable-feature=resolver", "--no-cache-dir", "--no-index", "--find-links", script.scratch_path, "base==1.0.0", ) > result = script.pip( "install", "--unstable-feature=resolver", "--no-cache-dir", "--no-index", "--find-links", script.scratch_path, "--user", "base==2.0.0", ) tests/functional/test_new_resolver_user.py:168: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ('python', '-m', 'pip', 'install', '--unstable-feature=resolver', '--no-cache-dir', ...) kw = {'expect_stderr': True} cwd = Path('/tmp/pytest-of-jku/pytest-1/popen-gw10/test_new_resolver_install_user0/workspace/scratch') run_from = None, allow_stderr_error = False, allow_stderr_warning = False, allow_error = None expect_error = None def run(self, *args, **kw): """ :param allow_stderr_error: whether a logged error is allowed in stderr. Passing True for this argument implies `allow_stderr_warning` since warnings are weaker than errors. :param allow_stderr_warning: whether a logged warning (or deprecation message) is allowed in stderr. :param allow_error: if True (default is False) does not raise exception when the command exit value is non-zero. Implies expect_error, but in contrast to expect_error will not assert that the exit value is zero. :param expect_error: if False (the default), asserts that the command exits with 0. Otherwise, asserts that the command exits with a non-zero exit code. Passing True also implies allow_stderr_error and allow_stderr_warning. :param expect_stderr: whether to allow warnings in stderr (equivalent to `allow_stderr_warning`). This argument is an abbreviated version of `allow_stderr_warning` and is also kept for backwards compatibility. """ if self.verbose: print('>> running {args} {kw}'.format(**locals())) cwd = kw.pop('cwd', None) run_from = kw.pop('run_from', None) assert not cwd or not run_from, "Don't use run_from; it's going away" cwd = cwd or run_from or self.cwd if sys.platform == 'win32': # Partial fix for ScriptTest.run using `shell=True` on Windows. args = [str(a).replace('^', '^^').replace('&', '^&') for a in args] # Remove `allow_stderr_error`, `allow_stderr_warning` and # `allow_error` before calling run() because PipTestEnvironment # doesn't support them. allow_stderr_error = kw.pop('allow_stderr_error', None) allow_stderr_warning = kw.pop('allow_stderr_warning', None) allow_error = kw.pop('allow_error', None) if allow_error: kw['expect_error'] = True # Propagate default values. expect_error = kw.get('expect_error') if expect_error: # Then default to allowing logged errors. if allow_stderr_error is not None and not allow_stderr_error: raise RuntimeError( 'cannot pass allow_stderr_error=False with ' 'expect_error=True' ) allow_stderr_error = True elif kw.get('expect_stderr'): # Then default to allowing logged warnings. if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'expect_stderr=True' ) allow_stderr_warning = True if allow_stderr_error: if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'allow_stderr_error=True' ) # Default values if not set. if allow_stderr_error is None: allow_stderr_error = False if allow_stderr_warning is None: allow_stderr_warning = allow_stderr_error # Pass expect_stderr=True to allow any stderr. We do this because # we do our checking of stderr further on in check_stderr(). kw['expect_stderr'] = True > result = super(PipTestEnvironment, self).run(cwd=cwd, *args, **kw) E AssertionError: Script returned code: 1 tests/lib/__init__.py:628: AssertionError ------------------------------------ Captured stdout call ------------------------------------- Script result: python -m pip install --unstable-feature=resolver --no-cache-dir --no-index --find-links /tmp/pytest-of-jku/pytest-1/popen-gw10/test_new_resolver_install_user0/workspace/scratch --user base==2.0.0 return code: 1 -- stderr: -------------------- ERROR: Will not install to the user site because it will lack sys.path precedence to base in /tmp/pytest-of-jku/pytest-1/popen-gw10/test_new_resolver_install_user0/workspace/venv/lib/python3.8/site-packages -- stdout: -------------------- Looking in links: /tmp/pytest-of-jku/pytest-1/popen-gw10/test_new_resolver_install_user0/workspace/scratch Processing ./base-2.0.0-py2.py3-none-any.whl ______________ test_new_resolver_install_user_conflict_in_global_and_user_sites _______________ [gw10] linux -- Python 3.8.3 /home/jku/src/pip/.tox/py38/bin/python script = @pytest.mark.incompatible_with_test_venv @pytest.mark.usefixtures("patch_dist_in_site_packages") def test_new_resolver_install_user_conflict_in_global_and_user_sites(script): """ Installing a different version in user site should ignore an existing different version in global site, but still upgrade the user site. """ create_basic_wheel_for_package(script, "base", "1.0.0") create_basic_wheel_for_package(script, "base", "2.0.0") script.pip( "install", "--unstable-feature=resolver", "--no-cache-dir", "--no-index", "--find-links", script.scratch_path, "base==2.0.0", ) > script.pip( "install", "--unstable-feature=resolver", "--no-cache-dir", "--no-index", "--find-links", script.scratch_path, "--user", "--force-reinstall", "base==2.0.0", ) tests/functional/test_new_resolver_user.py:199: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ('python', '-m', 'pip', 'install', '--unstable-feature=resolver', '--no-cache-dir', ...) kw = {'expect_stderr': True} cwd = Path('/tmp/pytest-of-jku/pytest-1/popen-gw10/test_new_resolver_install_user0/workspace/scratch') run_from = None, allow_stderr_error = False, allow_stderr_warning = False, allow_error = None expect_error = None def run(self, *args, **kw): """ :param allow_stderr_error: whether a logged error is allowed in stderr. Passing True for this argument implies `allow_stderr_warning` since warnings are weaker than errors. :param allow_stderr_warning: whether a logged warning (or deprecation message) is allowed in stderr. :param allow_error: if True (default is False) does not raise exception when the command exit value is non-zero. Implies expect_error, but in contrast to expect_error will not assert that the exit value is zero. :param expect_error: if False (the default), asserts that the command exits with 0. Otherwise, asserts that the command exits with a non-zero exit code. Passing True also implies allow_stderr_error and allow_stderr_warning. :param expect_stderr: whether to allow warnings in stderr (equivalent to `allow_stderr_warning`). This argument is an abbreviated version of `allow_stderr_warning` and is also kept for backwards compatibility. """ if self.verbose: print('>> running {args} {kw}'.format(**locals())) cwd = kw.pop('cwd', None) run_from = kw.pop('run_from', None) assert not cwd or not run_from, "Don't use run_from; it's going away" cwd = cwd or run_from or self.cwd if sys.platform == 'win32': # Partial fix for ScriptTest.run using `shell=True` on Windows. args = [str(a).replace('^', '^^').replace('&', '^&') for a in args] # Remove `allow_stderr_error`, `allow_stderr_warning` and # `allow_error` before calling run() because PipTestEnvironment # doesn't support them. allow_stderr_error = kw.pop('allow_stderr_error', None) allow_stderr_warning = kw.pop('allow_stderr_warning', None) allow_error = kw.pop('allow_error', None) if allow_error: kw['expect_error'] = True # Propagate default values. expect_error = kw.get('expect_error') if expect_error: # Then default to allowing logged errors. if allow_stderr_error is not None and not allow_stderr_error: raise RuntimeError( 'cannot pass allow_stderr_error=False with ' 'expect_error=True' ) allow_stderr_error = True elif kw.get('expect_stderr'): # Then default to allowing logged warnings. if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'expect_stderr=True' ) allow_stderr_warning = True if allow_stderr_error: if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'allow_stderr_error=True' ) # Default values if not set. if allow_stderr_error is None: allow_stderr_error = False if allow_stderr_warning is None: allow_stderr_warning = allow_stderr_error # Pass expect_stderr=True to allow any stderr. We do this because # we do our checking of stderr further on in check_stderr(). kw['expect_stderr'] = True > result = super(PipTestEnvironment, self).run(cwd=cwd, *args, **kw) E AssertionError: Script returned code: 1 tests/lib/__init__.py:628: AssertionError ------------------------------------ Captured stdout call ------------------------------------- Script result: python -m pip install --unstable-feature=resolver --no-cache-dir --no-index --find-links /tmp/pytest-of-jku/pytest-1/popen-gw10/test_new_resolver_install_user0/workspace/scratch --user --force-reinstall base==2.0.0 return code: 1 -- stderr: -------------------- ERROR: Will not install to the user site because it will lack sys.path precedence to base in /tmp/pytest-of-jku/pytest-1/popen-gw10/test_new_resolver_install_user0/workspace/venv/lib/python3.8/site-packages -- stdout: -------------------- Looking in links: /tmp/pytest-of-jku/pytest-1/popen-gw10/test_new_resolver_install_user0/workspace/scratch Processing ./base-2.0.0-py2.py3-none-any.whl ________ Tests_UninstallUserSite.test_uninstall_from_usersite_with_dist_in_global_site ________ [gw8] linux -- Python 3.8.3 /home/jku/src/pip/.tox/py38/bin/python self = virtualenv = script = @pytest.mark.fails_on_new_resolver def test_uninstall_from_usersite_with_dist_in_global_site( self, virtualenv, script): """ Test uninstall from usersite (with same dist in global site) """ _patch_dist_in_site_packages(virtualenv) script.pip_install_local('pip-test-package==0.1', '--no-binary=:all:') > result2 = script.pip_install_local( '--user', 'pip-test-package==0.1.1', '--no-binary=:all:') tests/functional/test_uninstall_user.py:35: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/lib/__init__.py:654: in pip_install_local return self.pip( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ('python', '-m', 'pip', 'install', '--no-index', '--find-links', ...) kw = {'expect_stderr': True} cwd = Path('/tmp/pytest-of-jku/pytest-1/popen-gw8/test_uninstall_from_usersite_w0/workspace/scratch') run_from = None, allow_stderr_error = False, allow_stderr_warning = False, allow_error = None expect_error = None def run(self, *args, **kw): """ :param allow_stderr_error: whether a logged error is allowed in stderr. Passing True for this argument implies `allow_stderr_warning` since warnings are weaker than errors. :param allow_stderr_warning: whether a logged warning (or deprecation message) is allowed in stderr. :param allow_error: if True (default is False) does not raise exception when the command exit value is non-zero. Implies expect_error, but in contrast to expect_error will not assert that the exit value is zero. :param expect_error: if False (the default), asserts that the command exits with 0. Otherwise, asserts that the command exits with a non-zero exit code. Passing True also implies allow_stderr_error and allow_stderr_warning. :param expect_stderr: whether to allow warnings in stderr (equivalent to `allow_stderr_warning`). This argument is an abbreviated version of `allow_stderr_warning` and is also kept for backwards compatibility. """ if self.verbose: print('>> running {args} {kw}'.format(**locals())) cwd = kw.pop('cwd', None) run_from = kw.pop('run_from', None) assert not cwd or not run_from, "Don't use run_from; it's going away" cwd = cwd or run_from or self.cwd if sys.platform == 'win32': # Partial fix for ScriptTest.run using `shell=True` on Windows. args = [str(a).replace('^', '^^').replace('&', '^&') for a in args] # Remove `allow_stderr_error`, `allow_stderr_warning` and # `allow_error` before calling run() because PipTestEnvironment # doesn't support them. allow_stderr_error = kw.pop('allow_stderr_error', None) allow_stderr_warning = kw.pop('allow_stderr_warning', None) allow_error = kw.pop('allow_error', None) if allow_error: kw['expect_error'] = True # Propagate default values. expect_error = kw.get('expect_error') if expect_error: # Then default to allowing logged errors. if allow_stderr_error is not None and not allow_stderr_error: raise RuntimeError( 'cannot pass allow_stderr_error=False with ' 'expect_error=True' ) allow_stderr_error = True elif kw.get('expect_stderr'): # Then default to allowing logged warnings. if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'expect_stderr=True' ) allow_stderr_warning = True if allow_stderr_error: if allow_stderr_warning is not None and not allow_stderr_warning: raise RuntimeError( 'cannot pass allow_stderr_warning=False with ' 'allow_stderr_error=True' ) # Default values if not set. if allow_stderr_error is None: allow_stderr_error = False if allow_stderr_warning is None: allow_stderr_warning = allow_stderr_error # Pass expect_stderr=True to allow any stderr. We do this because # we do our checking of stderr further on in check_stderr(). kw['expect_stderr'] = True > result = super(PipTestEnvironment, self).run(cwd=cwd, *args, **kw) E AssertionError: Script returned code: 1 tests/lib/__init__.py:628: AssertionError ------------------------------------ Captured stdout call ------------------------------------- Script result: python -m pip install --no-index --find-links file:///home/jku/src/pip/tests/data/packages --user pip-test-package==0.1.1 --no-binary=:all: return code: 1 -- stderr: -------------------- ERROR: Will not install to the user site because it will lack sys.path precedence to pip-test-package in /tmp/pytest-of-jku/pytest-1/popen-gw8/test_uninstall_from_usersite_w0/workspace/venv/lib/python3.8/site-packages -- stdout: -------------------- Looking in links: file:///home/jku/src/pip/tests/data/packages ```
pradyunsg commented 4 years ago

Ah. Our test's patching seems to be not working. :(