Expose git errors instead of printing a generic error message #9845
Cirrus CI / Tests / FreeBSD (Python 3.9) / pytest
failed
Nov 14, 2024 in 3m 1s
Task Summary
Instruction pytest failed in 01:36
Details
✅ 00:03 clone
✅ 01:01 bootstrap_poetry
✅ 00:17 setup_environment
❌ 01:36 pytest
[gw0] [ 99%] PASSED tests/installation/test_executor.py::test_build_backend_errors_are_reported_correctly_if_caused_by_subprocess[False-exception1-get_requires_for_build]
tests/installation/test_executor.py::test_executor_should_delete_incomplete_downloads
[gw0] [ 99%] PASSED tests/installation/test_executor.py::test_executor_should_delete_incomplete_downloads
tests/installation/test_executor.py::test_build_backend_errors_are_reported_correctly_if_caused_by_subprocess[False-exception0-build]
[gw1] [ 99%] PASSED tests/installation/test_executor.py::test_executor_should_write_pep610_url_references_for_wheel_urls[False]
tests/installation/test_executor.py::test_executor_should_write_pep610_url_references_for_non_wheel_urls[True-True-False-False]
[gw1] [ 99%] PASSED tests/installation/test_executor.py::test_executor_should_write_pep610_url_references_for_non_wheel_urls[True-True-False-False]
tests/puzzle/test_transaction.py::test_it_should_calculate_operations_for_installed_packages
[gw1] [ 99%] PASSED tests/puzzle/test_transaction.py::test_it_should_calculate_operations_for_installed_packages
tests/puzzle/test_transaction.py::test_it_should_update_installed_packages_if_sources_are_different
[gw1] [ 99%] PASSED tests/puzzle/test_transaction.py::test_it_should_update_installed_packages_if_sources_are_different
tests/puzzle/test_transaction.py::test_it_should_remove_installed_packages_if_required
[gw1] [ 99%] PASSED tests/puzzle/test_transaction.py::test_it_should_remove_installed_packages_if_required
tests/puzzle/test_transaction.py::test_it_should_not_remove_installed_packages_that_are_in_result
[gw1] [ 99%] PASSED tests/puzzle/test_transaction.py::test_it_should_not_remove_installed_packages_that_are_in_result
tests/puzzle/test_transaction.py::test_it_should_calculate_operations_in_correct_order
[gw1] [ 99%] PASSED tests/puzzle/test_transaction.py::test_it_should_calculate_operations_in_correct_order
[gw0] [ 99%] PASSED tests/installation/test_executor.py::test_build_backend_errors_are_reported_correctly_if_caused_by_subprocess[False-exception0-build]
tests/installation/test_executor.py::test_execute_prints_warning_for_invalid_wheels
[gw0] [100%] SKIPPED tests/installation/test_executor.py::test_execute_prints_warning_for_invalid_wheels
=================================== FAILURES ===================================
_______________ test_git_error_is_exposed_for_non_existent_repo ________________
[gw1] freebsd14 -- Python 3.9.20 /.cache/pypoetry/virtualenvs/poetry-XZqP7kBn-py3.9/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-gw1/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-gw1/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-gw1/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-gw1/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/integration/test_utils_vcs_git.py:316: HTTP authentication credentials not available
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_manager.py:1299: requires darwin
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/installation/test_executor.py:305: https://github.com/python-poetry/poetry/issues/7983
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-gw1/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-gw1/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-gw1/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-gw1/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 93.60s (0:01:33) ========
Annotations
Check failure on line 447 in tests/integration/test_utils_vcs_git.py
cirrus-ci / Tests / FreeBSD (Python 3.9) / 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-gw1/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-gw1/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-gw1/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-gw1/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