didi-lot1-ai/artefacte_lot1/output_teste/web/pytest_output.txt

63 lines
4.5 KiB
Text

============================= test session starts ==============================
platform linux -- Python 3.11.15, pytest-9.1.1, pluggy-1.6.0
rootdir: /app
configfile: pyproject.toml
testpaths: tests
plugins: anyio-4.14.1, respx-0.23.1, asyncio-1.4.0, cov-7.1.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function
collected 152 items
tests/test_api.py ..................... [ 13%]
tests/test_browse_client.py .F.... [ 17%]
tests/test_config.py ........ [ 23%]
tests/test_evidence_packer.py ...................... [ 37%]
tests/test_fetch_client.py ............. [ 46%]
tests/test_image_search_client.py ................ [ 56%]
tests/test_llm_provider.py ....... [ 61%]
tests/test_middleware.py ... [ 63%]
tests/test_orchestrator.py ......... [ 69%]
tests/test_schemas_common.py .......... [ 75%]
tests/test_search_client.py ............ [ 83%]
tests/test_validation.py .................FF [ 96%]
tests/test_vision_client.py ...... [100%]
=================================== FAILURES ===================================
________________ TestBrowseClientBrowse.test_browse_single_page ________________
tests/test_browse_client.py:100: in test_browse_single_page
assert "Main content" in response.pages[0].text
E AssertionError: assert 'Main content' in 'Content'
E + where 'Content' = BrowsePageResult(url='https://example.com/page', final_url='https://example.com/page', canonical_url=None, title='Test....040318+00:00', extraction_time_ms=5.37, warnings=[], screenshot_base64=None, viewport_width=1280, viewport_height=720).text
______________ TestValidateUrlsAsync.test_validates_multiple_urls ______________
tests/test_validation.py:137: in test_validates_multiple_urls
assert result == urls
E AssertionError: assert (['https://ex...e.com/c'], []) == ['https://exa...xample.com/c']
E
E At index 0 diff: ['https://example.com/a', 'https://example.com/b', 'https://example.com/c'] != 'https://example.com/a'
E Right contains one more item: 'https://example.com/c'
E Use -v to get more diff
___________ TestValidateUrlsAsync.test_raises_on_private_ip_in_batch ___________
tests/test_validation.py:145: in test_raises_on_private_ip_in_batch
with pytest.raises(ValueError, match="private/reserved"):
E Failed: DID NOT RAISE ValueError
------------------------------ Captured log call -------------------------------
WARNING web.validation:validation.py:150 Dropping URL https://evil.example.com/steal: URL hostname 'evil.example.com' resolves to private/reserved address 10.0.0.1
=============================== warnings summary ===============================
../usr/local/lib/python3.11/site-packages/fastapi/testclient.py:1
/usr/local/lib/python3.11/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
from starlette.testclient import TestClient as TestClient # noqa
tests/test_browse_client.py::TestBrowseClientBrowse::test_browse_single_page
tests/test_browse_client.py::TestBrowseClientBrowse::test_browse_handles_timeout
tests/test_browse_client.py::TestBrowseClientBrowse::test_browse_multiple_urls
/app/src/web/browse/client.py:445: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
page.on("response", _on_response)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
------------------ generated xml file: /app/test-results.xml -------------------
=========================== short test summary info ============================
FAILED tests/test_browse_client.py::TestBrowseClientBrowse::test_browse_single_page
FAILED tests/test_validation.py::TestValidateUrlsAsync::test_validates_multiple_urls
FAILED tests/test_validation.py::TestValidateUrlsAsync::test_raises_on_private_ip_in_batch
================== 3 failed, 149 passed, 4 warnings in 16.74s ==================