Expose git errors instead of printing a generic error message #9845
Cirrus CI / Tests / FreeBSD (Python 3.11) / pytest
failed
Nov 14, 2024 in 2m 42s
Task Summary
Instruction pytest failed in 01:22
Details
✅ 00:03 clone
✅ 01:00 bootstrap_poetry
✅ 00:14 setup_environment
❌ 01:22 pytest
[gw0] [ 99%] PASSED tests/utils/test_dependency_specification.py::test_parse_dependency_specification[demo@==1.0.0-expected_variants9]
tests/utils/test_dependency_specification.py::test_parse_dependency_specification[name [fred,bar] @ http://foo.com ; python_version=='2.7'-expected_variants21]
[gw0] [ 99%] PASSED tests/utils/test_dependency_specification.py::test_parse_dependency_specification[name [fred,bar] @ http://foo.com ; python_version=='2.7'-expected_variants21]
tests/utils/test_dependency_specification.py::test_parse_dependency_specification[demo[a,b]-expected_variants13]
[gw0] [ 99%] PASSED tests/utils/test_dependency_specification.py::test_parse_dependency_specification[demo[a,b]-expected_variants13]
tests/utils/test_dependency_specification.py::test_parse_dependency_specification[https://files.pythonhosted.org/distributions/demo-0.1.0.tar.gz-expected_variants16]
[gw0] [ 99%] PASSED tests/utils/test_dependency_specification.py::test_parse_dependency_specification[https://files.pythonhosted.org/distributions/demo-0.1.0.tar.gz-expected_variants16]
tests/utils/test_dependency_specification.py::test_parse_dependency_specification[demo[a,b]@1.0.0-expected_variants12]
[gw0] [ 99%] PASSED tests/utils/test_dependency_specification.py::test_parse_dependency_specification[demo[a,b]@1.0.0-expected_variants12]
tests/utils/test_dependency_specification.py::test_parse_dependency_specification[git+http://github.com/demo/demo.git-expected_variants0]
[gw1] [ 99%] PASSED tests/console/commands/test_check.py::test_check_invalid
tests/console/commands/test_check.py::test_check_valid_legacy
[gw0] [ 99%] PASSED tests/utils/test_dependency_specification.py::test_parse_dependency_specification[git+http://github.com/demo/demo.git-expected_variants0]
tests/utils/test_dependency_specification.py::test_parse_dependency_specification[name@http://foo.com-expected_variants20]
[gw0] [ 99%] PASSED tests/utils/test_dependency_specification.py::test_parse_dependency_specification[name@http://foo.com-expected_variants20]
tests/utils/test_dependency_specification.py::test_parse_dependency_specification[git+https://github.com/demo/demo.git@main-expected_variants4]
[gw0] [ 99%] PASSED tests/utils/test_dependency_specification.py::test_parse_dependency_specification[git+https://github.com/demo/demo.git@main-expected_variants4]
[gw1] [ 99%] PASSED tests/console/commands/test_check.py::test_check_valid_legacy
tests/console/commands/test_check.py::test_check_lock_missing[-All set!\n-0]
[gw1] [100%] PASSED tests/console/commands/test_check.py::test_check_lock_missing[-All set!\n-0]
=================================== FAILURES ===================================
_______________ test_git_error_is_exposed_for_non_existent_repo ________________
[gw0] freebsd14 -- Python 3.11.10 /.cache/pypoetry/virtualenvs/poetry-XZqP7kBn-py3.11/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/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/test_python_manager.py:98: Windows only
SKIPPED [1] tests/utils/env/test_env_manager.py:1299: requires darwin
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-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 80.00s (0:01:19) ========
Annotations
Check failure on line 447 in tests/integration/test_utils_vcs_git.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / 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