Skip to content

Commit bfba43c

Browse files
authored
Relax test_list_installed_deps() to allow other packages (#2796)
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.
1 parent 6253d62 commit bfba43c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/changelog/2796.misc.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Relax the assertion in ``test_list_installed_deps`` to allow packages
2+
other than ``pip`` to be present in the fresh venv, to fix tests
3+
on PyPy.

tests/tox_env/python/test_python_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,6 @@ def test_list_installed_deps(in_ci: bool, tox_project: ToxProjectCreator, mocker
186186
mocker.patch("tox.tox_env.python.api.is_ci", return_value=in_ci)
187187
result = tox_project({"tox.ini": "[testenv]\nskip_install = true"}).run("r", "-e", "py")
188188
if in_ci:
189-
assert "py: pip==" in result.out
189+
assert "pip==" in result.out
190190
else:
191-
assert "py: pip==" not in result.out
191+
assert "pip==" not in result.out

0 commit comments

Comments
 (0)