feat: improve operation messages and make them stateful #9245
Task Summary
Instruction pytest failed in 01:24
Details
ℹ️ Scheduling was delayed due to a concurrency limit on community tasks
✅ 00:03 clone
✅ 01:00 bootstrap_poetry
✅ 00:15 setup_environment
❌ 01:24 pytest
Writing lock file
"""
> assert tester.io.fetch_output() == expected_output
E AssertionError: assert 'Updating dep...ile written\n' == 'Updating dep...g lock file\n'
E
E Updating dependencies
E Resolving dependencies...
E
E - Writing lock file
E + Lock file written
/tmp/cirrus-ci-build/tests/console/commands/self/test_install.py:61: AssertionError
------------------------------ Captured log setup ------------------------------
INFO root:builtin.py:72 find interpreter for spec PythonSpec(path=/.cache/pypoetry/virtualenvs/poetry-XZqP7kBn-py3.9/bin/python)
INFO root:builtin.py:79 proposed PythonInfo(spec=CPython3.9.19.final.0-64, system=/usr/local/bin/python3.9, exe=/.cache/pypoetry/virtualenvs/poetry-XZqP7kBn-py3.9/bin/python, platform=freebsd14, version='3.9.19 (main, Aug 8 2024, 01:11:14) \n[Clang 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1', encoding_fs_io=utf-8-utf-8)
INFO root:session.py:50 create virtual environment via CPython3Posix(dest=/tmp/pytest-of-root/pytest-0/popen-gw1/test_self_install_None_0/venv, clear=False, no_vcs_ignore=False, global=False)
INFO root:session.py:63 add activators for Bash, CShell, Fish, Nushell, PowerShell, Python
-------------- generated xml file: /tmp/cirrus-ci-build/junit.xml --------------
=========================== short test summary info ============================
SKIPPED [1] tests/console/commands/test_run.py:88: Poetry only installs CMD script files for console scripts of editable dependencies on Windows
SKIPPED [1] tests/utils/env/test_env.py:525: Windows only
SKIPPED [1] tests/utils/env/test_env_manager.py:1289: requires darwin
SKIPPED [1] tests/puzzle/test_solver.py:3799: Poetry no longer has critical package requirements
SKIPPED [1] tests/integration/test_utils_vcs_git.py:315: HTTP authentication credentials not available
SKIPPED [1] tests/installation/test_executor.py:306: https://github.com/python-poetry/poetry/issues/7983
SKIPPED [1] tests/installation/test_installer.py:1794: This is not working at the moment due to limitations in the resolver
FAILED tests/console/commands/test_add.py::test_add_no_constraint - AssertionError: assert 'Using versio...ile written\n' == 'Using versio...g lock file\n'
Using version ^0.2.0 for cachy
Updating dependencies
Resolving dependencies...
Package operations: 2 installs, 0 updates, 0 removals
- Installing msgpack-python (0.5.6)
- Installing cachy (0.2.0)
- Writing lock file
+ Lock file written
FAILED tests/console/commands/self/test_install.py::test_self_install[[tool.poetry]\nname = "poetry-instance"\nversion = "1.2"\ndescription = ""\nauthors = []\nlicense = ""\n# no package-mode -> defaults to true\n\n[tool.poetry.dependencies]\npython = "3.9"\npoetry = "1.2"\n] - AssertionError: assert 'Updating dep...ile written\n' == 'Updating dep...g lock file\n'
Updating dependencies
Resolving dependencies...
- Writing lock file
+ Lock file written
FAILED tests/console/commands/self/test_install.py::test_self_install[None] - AssertionError: assert 'Updating dep...ile written\n' == 'Updating dep...g lock file\n'
Updating dependencies
Resolving dependencies...
- Writing lock file
+ Lock file written
============= 3 failed, 1710 passed, 7 skipped in 82.56s (0:01:22) =============
Annotations
Check failure on line 126 in tests/console/commands/test_add.py
cirrus-ci / Tests / FreeBSD (Python 3.9) / pytest
tests/console/commands/test_add.py#L126
tests.console.commands.test_add.test_add_no_constraint
Raw output
app = <tests.helpers.PoetryTestApplication object at 0xe45632bce20>
tester = <cleo.testers.command_tester.CommandTester object at 0xe4568636040>
def test_add_no_constraint(app: PoetryTestApplication, tester: CommandTester) -> None:
tester.execute("cachy")
expected = """\
Using version ^0.2.0 for cachy
Updating dependencies
Resolving dependencies...
Package operations: 2 installs, 0 updates, 0 removals
- Installing msgpack-python (0.5.6)
- Installing cachy (0.2.0)
Writing lock file
"""
> assert tester.io.fetch_output() == expected
E AssertionError: assert 'Using versio...ile written\n' == 'Using versio...g lock file\n'
E
E Using version ^0.2.0 for cachy
E
E Updating dependencies
E Resolving dependencies...
E
E Package operations: 2 installs, 0 updates, 0 removals
E
E - Installing msgpack-python (0.5.6)
E - Installing cachy (0.2.0)
E
E - Writing lock file
E + Lock file written
/tmp/cirrus-ci-build/tests/console/commands/test_add.py:126: AssertionError
Check failure on line 61 in tests/console/commands/test_install.py
cirrus-ci / Tests / FreeBSD (Python 3.9) / pytest
tests/console/commands/test_install.py#L61
tests.console.commands.self.test_install.test_self_install[[tool.poetry]\nname = "poetry-instance"\nversion = "1.2"\ndescription = ""\nauthors = []\nlicense = ""\n# no package-mode -> defaults to true\n\n[tool.poetry.dependencies]\npython = "3.9"\npoetry = "1.2"\n]
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0xd867f7a5d90>
pyproject_content = '[tool.poetry]\nname = "poetry-instance"\nversion = "1.2"\ndescription = ""\nauthors = []\nlicense = ""\n# no package-mode -> defaults to true\n\n[tool.poetry.dependencies]\npython = "3.9"\npoetry = "1.2"\n'
@pytest.mark.parametrize(
"pyproject_content",
(
None,
"""\
[tool.poetry]
name = "poetry-instance"
version = "1.2"
description = ""
authors = []
license = ""
# no package-mode -> defaults to true
[tool.poetry.dependencies]
python = "3.9"
poetry = "1.2"
""",
),
)
def test_self_install(
tester: CommandTester,
pyproject_content: str | None,
) -> None:
command = tester.command
assert isinstance(command, SelfInstallCommand)
pyproject_path = command.system_pyproject
if pyproject_content:
pyproject_path.write_text(pyproject_content, encoding="utf-8")
else:
assert not pyproject_path.exists()
tester.execute()
expected_output = """\
Updating dependencies
Resolving dependencies...
Writing lock file
"""
> assert tester.io.fetch_output() == expected_output
E AssertionError: assert 'Updating dep...ile written\n' == 'Updating dep...g lock file\n'
E
E Updating dependencies
E Resolving dependencies...
E
E - Writing lock file
E + Lock file written
/tmp/cirrus-ci-build/tests/console/commands/self/test_install.py:61: AssertionError
Check failure on line 61 in tests/console/commands/test_install.py
cirrus-ci / Tests / FreeBSD (Python 3.9) / pytest
tests/console/commands/test_install.py#L61
tests.console.commands.self.test_install.test_self_install[None]
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0xd867e2937c0>
pyproject_content = None
@pytest.mark.parametrize(
"pyproject_content",
(
None,
"""\
[tool.poetry]
name = "poetry-instance"
version = "1.2"
description = ""
authors = []
license = ""
# no package-mode -> defaults to true
[tool.poetry.dependencies]
python = "3.9"
poetry = "1.2"
""",
),
)
def test_self_install(
tester: CommandTester,
pyproject_content: str | None,
) -> None:
command = tester.command
assert isinstance(command, SelfInstallCommand)
pyproject_path = command.system_pyproject
if pyproject_content:
pyproject_path.write_text(pyproject_content, encoding="utf-8")
else:
assert not pyproject_path.exists()
tester.execute()
expected_output = """\
Updating dependencies
Resolving dependencies...
Writing lock file
"""
> assert tester.io.fetch_output() == expected_output
E AssertionError: assert 'Updating dep...ile written\n' == 'Updating dep...g lock file\n'
E
E Updating dependencies
E Resolving dependencies...
E
E - Writing lock file
E + Lock file written
/tmp/cirrus-ci-build/tests/console/commands/self/test_install.py:61: AssertionError