ITADN

`test_list_poetry_managed[False]` test failing over whitespace differences

#10796Closedmgorny 创建于 2026-03-29
kind/bugarea/testing
M
mgornycommented
### Description I'm seeing `tests/console/commands/python/test_python_list.py::test_list_poetry_managed[False]` failing over what seems to be an extra space: ``` Full diff: { - '3.10.8 PyPy Poetry ' + '3.10.8 PyPy Poetry ' ? + '/tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/pypy', - '3.10.8 PyPy Poetry ' + '3.10.8 PyPy Poetry ' ? + '/tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/python', - '3.14.0t CPython Poetry ' + '3.14.0t CPython Poetry ' ? + '/tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.14.0t/bin/python', - '3.9.1 CPython Poetry ' + '3.9.1 CPython Poetry ' ? + '/tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.9.1/bin/python', } ``` Reproduced on top of 2.3.3 and 95cd84c149a14b55ae8e41328bc6752fbb8b6883. <details> ```pytb $ poetry install Creating virtualenv poetry-B7fwsm4C-py3.14 in /home/mgorny/.cache/pypoetry/virtualenvs Installing dependencies from lock file Package operations: 68 installs, 0 updates, 0 removals - Installing anyio (4.12.1) - Installing build (1.4.0) - Installing cachecontrol (0.14.4) - Installing certifi (2026.1.4) - Installing cffi (2.0.0) - Installing cfgv (3.5.0) - Installing charset-normalizer (3.4.4) - Installing cleo (2.1.0) - Installing coverage (7.13.1) - Installing crashtest (0.4.1) - Installing cryptography (46.0.3) - Installing deepdiff (8.6.1) - Installing distlib (0.4.0) - Installing execnet (2.1.2) - Installing dulwich (1.0.0) - Installing fastjsonschema (2.21.2) - Installing filelock (3.20.3) - Installing findpython (0.7.1) - Installing h11 (0.16.0) - Installing httpcore (1.0.9) - Installing httpx (0.28.1) - Installing identify (2.6.16) - Installing idna (3.11) - Installing iniconfig (2.3.0) - Installing installer (0.7.0) - Installing jaraco-classes (3.4.0) - Installing jaraco-context (6.1.0) - Installing jaraco-functools (4.4.0) - Installing jeepney (0.9.0) - Installing keyring (25.7.0) - Installing librt (0.7.8) - Installing more-itertools (10.8.0) - Installing msgpack (1.1.2) - Installing mypy (1.19.1) - Installing mypy-extensions (1.1.0) - Installing nodeenv (1.10.0) - Installing orderly-set (5.5.0) - Installing packaging (25.0) - Installing pluggy (1.6.0) - Installing platformdirs (4.5.1) - Installing pkginfo (1.12.1.2) - Installing pbs-installer (2026.1.14) - Installing poetry-core (2.3.2) - Installing pre-commit (4.5.1) - Installing pathspec (1.0.3) - Installing psutil (7.2.1) - Installing pycparser (2.23) - Installing pygments (2.19.2) - Installing pyproject-hooks (1.2.0) - Installing pytest (9.0.2) - Installing pytest-cov (7.0.0) - Installing pytest-mock (3.15.1) - Installing pytest-randomly (4.0.1) - Installing pytest-xdist (3.8.0) - Installing pyyaml (6.0.3) - Installing rapidfuzz (3.14.3) - Installing requests (2.32.5) - Installing requests-toolbelt (1.0.0) - Installing responses (0.25.8) - Installing secretstorage (3.5.0) - Installing shellingham (1.5.4) - Installing tomlkit (0.14.0) - Installing trove-classifiers (2026.1.14.14) - Installing types-requests (2.32.4.20260107) - Installing typing-extensions (4.15.0) - Installing urllib3 (2.6.3) - Installing virtualenv (20.36.1) - Installing zstandard (0.25.0) Installing the current project: poetry (2.4.0.dev0) $ poetry run pytest -n1 -vv tests/console/commands/python/test_python_list.py::test_list_poetry_managed========================================================= test session starts ========================================================= platform linux -- Python 3.14.3, pytest-9.0.2, pluggy-1.6.0 -- /home/mgorny/.cache/pypoetry/virtualenvs/poetry-B7fwsm4C-py3.14/bin/pyth on cachedir: .pytest_cache Using --randomly-seed=1168106026 rootdir: /tmp/poetry configfile: pyproject.toml plugins: anyio-4.12.1, mock-3.15.1, randomly-4.0.1, cov-7.0.0, xdist-3.8.0 1 worker [2 items] scheduling tests via LoadScheduling tests/console/commands/python/test_python_list.py::test_list_poetry_managed[True] [gw0] [ 50%] PASSED tests/console/commands/python/test_python_list.py::test_list_poetry_managed[True] tests/console/commands/python/test_python_list.py::test_list_poetry_managed[False] [gw0] [100%] FAILED tests/console/commands/python/test_python_list.py::test_list_poetry_managed[False] ============================================================== FAILURES =============================================================== ___________________________________________________ test_list_poetry_managed[False] ___________________________________________________ [gw0] linux -- Python 3.14.3 /home/mgorny/.cache/pypoetry/virtualenvs/poetry-B7fwsm4C-py3.14/bin/python tester = <cleo.testers.command_tester.CommandTester object at 0x7fd01420f390> config = <tests.conftest.Config object at 0x7fd01420c550> mocked_poetry_managed_python_register = <function mocked_poetry_managed_python_register.<locals>.register at 0x7fd00ff65380> only_poetry_managed = False @pytest.mark.parametrize("only_poetry_managed", [False, True]) def test_list_poetry_managed( tester: CommandTester, config: Config, mocked_poetry_managed_python_register: MockedPoetryPythonRegister, only_poetry_managed: bool, ) -> None: mocked_poetry_managed_python_register("3.9.1", "cpython") mocked_poetry_managed_python_register("3.10.8", "pypy") mocked_poetry_managed_python_register("3.14.0", "cpython", free_threaded=True) tester.execute("-m" if only_poetry_managed else "") lines = tester.io.fetch_output().splitlines() system_lines = [line.strip() for line in lines if "System" in line] poetry_lines = [line.strip() for line in lines if "Poetry" in line] install_dir = config.python_installation_dir.as_posix() bin_dir = "" if WINDOWS else "bin/" expected = { f"3.10.8 PyPy Poetry {install_dir}/pypy@3.10.8/{bin_dir}pypy", f"3.10.8 PyPy Poetry {install_dir}/pypy@3.10.8/{bin_dir}python", f"3.9.1 CPython Poetry {install_dir}/cpython@3.9.1/{bin_dir}python", f"3.14.0t CPython Poetry {install_dir}/cpython@3.14.0t/{bin_dir}python", } > assert set(poetry_lines) == expected E AssertionError: assert {'3.9.1 CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_Fals e0/.local/share/pypoetry/python/cpython@3.9.1/bin/python', '3.14.0t CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/te st_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.14.0t/bin/python', '3.10.8 PyPy Poetry /tmp/pytest-of -mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/python', '3.10.8 PyPy Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/pypy'} == {'3.9.1 CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/pyt hon/cpython@3.9.1/bin/python', '3.10.8 PyPy Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0 /.local/share/pypoetry/python/pypy@3.10.8/bin/python', '3.14.0t CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_li st_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.14.0t/bin/python', '3.10.8 PyPy Poetry /tmp/pytest-of-mgorn y/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/pypy'} E E Extra items in the left set: E '3.14.0t CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoet ry/python/cpython@3.14.0t/bin/python' E '3.9.1 CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoet ry/python/cpython@3.9.1/bin/python' E '3.10.8 PyPy Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoet ry/python/pypy@3.10.8/bin/python' E '3.10.8 PyPy Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoet ry/python/pypy@3.10.8/bin/pypy' E Extra items in the right set: E '3.10.8 PyPy Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetr y/python/pypy@3.10.8/bin/pypy' E '3.10.8 PyPy Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetr y/python/pypy@3.10.8/bin/python' E '3.14.0t CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetr y/python/cpython@3.14.0t/bin/python' E '3.9.1 CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetr y/python/cpython@3.9.1/bin/python' E E Full diff: E { E - '3.10.8 PyPy Poetry ' E + '3.10.8 PyPy Poetry ' E ? + E '/tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/ pypy', E - '3.10.8 PyPy Poetry ' E + '3.10.8 PyPy Poetry ' E ? + E '/tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/ python', E - '3.14.0t CPython Poetry ' E + '3.14.0t CPython Poetry ' E ? + E '/tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.14.0t/ bin/python', E - '3.9.1 CPython Poetry ' E + '3.9.1 CPython Poetry ' E ? + E '/tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.9.1/bi n/python', E } /tmp/poetry/tests/console/commands/python/test_python_list.py:100: AssertionError ======================================================= short test summary info ======================================================= FAILED tests/console/commands/python/test_python_list.py::test_list_poetry_managed[False] - AssertionError: assert {'3.9.1 CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.9.1/bin/python', '3.14.0t CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.14.0t/bin/python', '3.10.8 PyPy Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/python', '3.10.8 PyPy Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/pypy'} == {'3.9.1 CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.9.1/bin/python', '3.10.8 PyPy Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/python', '3.14.0t CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.14.0t/bin/python', '3.10.8 PyPy Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/pypy'} Extra items in the left set: '3.14.0t CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.14.0t/bin/python' '3.9.1 CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.9.1/bin/python' '3.10.8 PyPy Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/python' '3.10.8 PyPy Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/pypy' Extra items in the right set: '3.10.8 PyPy Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/pypy' '3.10.8 PyPy Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/python' '3.14.0t CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.14.0t/bin/python' '3.9.1 CPython Poetry /tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.9.1/bin/python' Full diff: { - '3.10.8 PyPy Poetry ' + '3.10.8 PyPy Poetry ' ? + '/tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/pypy', - '3.10.8 PyPy Poetry ' + '3.10.8 PyPy Poetry ' ? + '/tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/pypy@3.10.8/bin/python', - '3.14.0t CPython Poetry ' + '3.14.0t CPython Poetry ' ? + '/tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.14.0t/bin/python', - '3.9.1 CPython Poetry ' + '3.9.1 CPython Poetry ' ? + '/tmp/pytest-of-mgorny/pytest-5/popen-gw0/test_list_poetry_managed_False0/.local/share/pypoetry/python/cpython@3.9.1/bin/python', } ===================================================== 1 failed, 1 passed in 3.01s ===================================================== ``` </details> ### Workarounds n/a ### Poetry Installation Method system package manager (eg: dnf, apt etc.) ### Operating System Gentoo Linux amd64 ### Poetry Version Poetry (version 2.3.3) ### Poetry Configuration ```bash session cache-dir = "/home/mgorny/.cache/pypoetry" data-dir = "/home/mgorny/.local/share/pypoetry" installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = false keyring.enabled = true python.installation-dir = "{data-dir}/python" # /home/mgorny/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /home/mgorny/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false ``` ### Python Sysconfig [sysconfig.txt](https://github.com/user-attachments/files/26332577/sysconfig.txt) ### Example pyproject.toml ```TOML ``` ### Poetry Runtime Logs n/a
关闭于 2026-04-03 2 条评论