Expose git errors instead of printing a generic error message #9845
Cirrus CI / Tests / FreeBSD (Python 3.10) / pytest
failed
Nov 14, 2024 in 3m 18s
Task Summary
Instruction pytest failed in 01:37
Details
ℹ️ Scheduling was delayed due to a concurrency limit on community tasks
✅ 00:03 clone
✅ 01:15 bootstrap_poetry
✅ 00:17 setup_environment
❌ 01:37 pytest
[gw1] [ 99%] PASSED tests/utils/env/test_env.py::test_env_system_packages_are_relative_to_lib[False]
tests/utils/env/test_env.py::test_run_with_keyboard_interrupt
[gw0] [ 99%] PASSED tests/utils/env/test_env.py::test_command_from_bin_preserves_relative_path
[gw1] [ 99%] PASSED tests/utils/env/test_env.py::test_run_with_keyboard_interrupt
tests/utils/env/test_env.py::test_env_finds_the_correct_executables_for_generic_env
tests/utils/env/test_env.py::test_call_no_input_with_called_process_error
[gw1] [ 99%] PASSED tests/utils/env/test_env.py::test_call_no_input_with_called_process_error
tests/utils/env/test_env.py::test_env_finds_the_correct_executables
[gw1] [ 99%] PASSED tests/utils/env/test_env.py::test_env_finds_the_correct_executables
tests/utils/env/test_env.py::test_run_python_script_only_stdout
[gw0] [ 99%] PASSED tests/utils/env/test_env.py::test_env_finds_the_correct_executables_for_generic_env
tests/utils/env/test_env.py::test_virtualenvs_with_spaces_in_their_path_work_as_expected
[gw1] [ 99%] PASSED tests/utils/env/test_env.py::test_run_python_script_only_stdout
tests/utils/env/test_env.py::test_env_system_packages_are_relative_to_lib[True]
[gw0] [ 99%] PASSED tests/utils/env/test_env.py::test_virtualenvs_with_spaces_in_their_path_work_as_expected
tests/console/commands/self/test_remove_plugins.py::test_remove_installed_package_dry_run
[gw1] [ 99%] PASSED tests/utils/env/test_env.py::test_env_system_packages_are_relative_to_lib[True]
tests/console/commands/self/test_remove_plugins.py::test_remove_installed_package
[gw0] [ 99%] PASSED tests/console/commands/self/test_remove_plugins.py::test_remove_installed_package_dry_run
[gw1] [100%] PASSED tests/console/commands/self/test_remove_plugins.py::test_remove_installed_package
=================================== FAILURES ===================================
_______________ test_git_error_is_exposed_for_non_existent_repo ________________
[gw0] freebsd14 -- Python 3.10.15 /.cache/pypoetry/virtualenvs/poetry-XZqP7kBn-py3.10/bin/python
def test_git_error_is_exposed_for_non_existent_repo() -> None:
source_url = "https://github.com/python-poetry/test-fixture-vcs-repo.git"
branch = uuid.uuid4().hex
with pytest.raises(PoetryConsoleError) as e:
Git.clone(url=source_url, branch=branch)
> assert "remote: Repository not found." in str(e.value)
E assert 'remote: Repository not found.' in "Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/pytest-of-root/pytest-0/popen-gw0/test_git_error_is_exposed_for_0/.cache/pypoetry/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n"
E + where "Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/pytest-of-root/pytest-0/popen-gw0/test_git_error_is_exposed_for_0/.cache/pypoetry/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n" = str(PoetryConsoleError("Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/pytest-of-root/pytest-0/popen-gw0/test_git_error_is_exposed_for_0/.cache/pypoetry/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n"))
E + where PoetryConsoleError("Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/pytest-of-root/pytest-0/popen-gw0/test_git_error_is_exposed_for_0/.cache/pypoetry/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n") = <ExceptionInfo PoetryConsoleError("Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/py...y/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n") tblen=3>.value
/tmp/cirrus-ci-build/tests/integration/test_utils_vcs_git.py:447: AssertionError
=============================== warnings summary ===============================
tests/utils/test_python_manager.py::test_get_preferred_python_use_poetry_python_disabled_fallback
/tmp/cirrus-ci-build/tests/utils/test_python_manager.py:77: PytestMockWarning: Mocks returned by pytest-mock do not need to be used as context managers. The mocker fixture automatically undoes mocking at the end of a test. This warning can be ignored if it was triggered by mocking a context manager. https://pytest-mock.readthedocs.io/en/latest/remarks.html#usage-as-context-manager
with mocker.patch(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
-------------- generated xml file: /tmp/cirrus-ci-build/junit.xml --------------
=========================== short test summary info ============================
SKIPPED [1] tests/utils/test_python_manager.py:98: Windows only
SKIPPED [3] tests/console/commands/env/test_activate.py:52: Only Windows shells
SKIPPED [1] tests/integration/test_utils_vcs_git.py:316: HTTP authentication credentials not available
SKIPPED [1] tests/installation/test_executor.py:305: https://github.com/python-poetry/poetry/issues/7983
SKIPPED [1] tests/utils/env/test_env_manager.py:1299: requires darwin
SKIPPED [1] tests/console/commands/test_run.py:88: Poetry only installs CMD script files for console scripts of editable dependencies on Windows
FAILED tests/integration/test_utils_vcs_git.py::test_git_error_is_exposed_for_non_existent_repo - assert 'remote: Repository not found.' in "Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/pytest-of-root/pytest-0/popen-gw0/test_git_error_is_exposed_for_0/.cache/pypoetry/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n"
+ where "Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/pytest-of-root/pytest-0/popen-gw0/test_git_error_is_exposed_for_0/.cache/pypoetry/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n" = str(PoetryConsoleError("Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/pytest-of-root/pytest-0/popen-gw0/test_git_error_is_exposed_for_0/.cache/pypoetry/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n"))
+ where PoetryConsoleError("Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/pytest-of-root/pytest-0/popen-gw0/test_git_error_is_exposed_for_0/.cache/pypoetry/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n") = <ExceptionInfo PoetryConsoleError("Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/py...y/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n") tblen=3>.value
======= 1 failed, 1711 passed, 8 skipped, 1 warning in 94.66s (0:01:34) ========
Annotations
Check failure on line 447 in tests/integration/test_utils_vcs_git.py
cirrus-ci / Tests / FreeBSD (Python 3.10) / pytest
tests/integration/test_utils_vcs_git.py#L447
tests.integration.test_utils_vcs_git.test_git_error_is_exposed_for_non_existent_repo
Raw output
def test_git_error_is_exposed_for_non_existent_repo() -> None:
source_url = "https://github.com/python-poetry/test-fixture-vcs-repo.git"
branch = uuid.uuid4().hex
with pytest.raises(PoetryConsoleError) as e:
Git.clone(url=source_url, branch=branch)
> assert "remote: Repository not found." in str(e.value)
E assert 'remote: Repository not found.' in "Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/pytest-of-root/pytest-0/popen-gw0/test_git_error_is_exposed_for_0/.cache/pypoetry/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n"
E + where "Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/pytest-of-root/pytest-0/popen-gw0/test_git_error_is_exposed_for_0/.cache/pypoetry/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n" = str(PoetryConsoleError("Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/pytest-of-root/pytest-0/popen-gw0/test_git_error_is_exposed_for_0/.cache/pypoetry/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n"))
E + where PoetryConsoleError("Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/pytest-of-root/pytest-0/popen-gw0/test_git_error_is_exposed_for_0/.cache/pypoetry/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n") = <ExceptionInfo PoetryConsoleError("Failed to clone https://github.com/python-poetry/test-fixture-vcs-repo.git\n Cloning into '/tmp/py...y/src/test-fixture-vcs-repo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\n") tblen=3>.value
/tmp/cirrus-ci-build/tests/integration/test_utils_vcs_git.py:447: AssertionError
Loading