Skip to content

Commit

Permalink
Relax test_list_installed_deps() to allow other packages (#2796)
Browse files Browse the repository at this point in the history
Relax the check in `test_list_installed_deps()` to allow `pip freeze`
to return other packages before `pip`.  This is necessary
if the Python interpreter vendors some packages itself, so that they
are available even in fresh venv.  This is the case e.g. for cffi
in PyPy.
  • Loading branch information
mgorny committed Dec 31, 2022
1 parent 6253d62 commit bfba43c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docs/changelog/2796.misc.rst
@@ -0,0 +1,3 @@
Relax the assertion in ``test_list_installed_deps`` to allow packages
other than ``pip`` to be present in the fresh venv, to fix tests
on PyPy.
4 changes: 2 additions & 2 deletions tests/tox_env/python/test_python_api.py
Expand Up @@ -186,6 +186,6 @@ def test_list_installed_deps(in_ci: bool, tox_project: ToxProjectCreator, mocker
mocker.patch("tox.tox_env.python.api.is_ci", return_value=in_ci)
result = tox_project({"tox.ini": "[testenv]\nskip_install = true"}).run("r", "-e", "py")
if in_ci:
assert "py: pip==" in result.out
assert "pip==" in result.out
else:
assert "py: pip==" not in result.out
assert "pip==" not in result.out

0 comments on commit bfba43c

Please sign in to comment.