============================= test session starts ============================= platform win32 -- Python 3.12.8, pytest-9.1.1, pluggy-1.6.0 rootdir: C:\Github\transcription configfile: pyproject.toml plugins: anyio-4.14.2, asyncio-1.4.0 asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function collected 52 items tests\ui\test_documents_page.py ...F.... [ 15%] tests\ui\test_jobs_page.py ....F.... [ 32%] tests\ui\test_navigation_and_mounts.py .......F. [ 50%] tests\ui\test_pages_registration.py F [ 51%] tests\ui\test_people_page.py .......... [ 71%] tests\ui\test_sources_page.py ..FFFFFFFF [ 90%] tests\ui\test_upload_page.py ..... [100%] ================================== FAILURES =================================== _ TestDocumentsPageRendering.test_document_detail_page_renders_bento_grid_and_metadata _ self = app_client = (, ) seed_person_and_document = ('1f55fb6e-a343-4f2e-a461-c3c22e493d2f', '5060421f-64ac-47a1-8249-24c9e656c565') @pytest.mark.asyncio async def test_document_detail_page_renders_bento_grid_and_metadata( self, app_client, seed_person_and_document ): _, client = app_client doc_id, _ = seed_person_and_document response = client.get(f"/ui/documents/{doc_id}") assert response.status_code == 200 > assert "Document Record" in response.text E assert 'Document Record' in '\n\n \n NiceGUI\n \n \n' E + where '\n\n \n NiceGUI\n \n \n' = .text tests\ui\test_documents_page.py:92: AssertionError ---------------------------- Captured stdout call ----------------------------- 2026-08-05 18:31:12 INFO | HTTP Request: GET http://testserver/ui/documents/1f55fb6e-a343-4f2e-a461-c3c22e493d2f "HTTP/1.1 200 OK" ------------------------------ Captured log call ------------------------------ INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/documents/1f55fb6e-a343-4f2e-a461-c3c22e493d2f "HTTP/1.1 200 OK" ___ TestJobsPageRendering.test_job_detail_page_renders_logistics_and_links ____ self = app_client = (, ) seed_document_with_unlinked_job = ('17a8ca60-ae2e-4189-9642-048a79bf5633', 'c2863ebc-5c9a-4033-9451-bd516b46bc7b') @pytest.mark.asyncio async def test_job_detail_page_renders_logistics_and_links( self, app_client, seed_document_with_unlinked_job ): _, client = app_client _, job_id = seed_document_with_unlinked_job response = client.get(f"/ui/jobs/{job_id}") assert response.status_code == 200 assert f"Job Record: {job_id}" in response.text > assert "Job Execution Logistics" in response.text E assert 'Job Execution Logistics' in '\n\n \n NiceGUI\n \n \n' E + where '\n\n \n NiceGUI\n \n \n' = .text tests\ui\test_jobs_page.py:97: AssertionError ---------------------------- Captured stdout call ----------------------------- 2026-08-05 18:31:13 INFO | HTTP Request: GET http://testserver/ui/jobs/c2863ebc-5c9a-4033-9451-bd516b46bc7b "HTTP/1.1 200 OK" ------------------------------ Captured log call ------------------------------ INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/jobs/c2863ebc-5c9a-4033-9451-bd516b46bc7b "HTTP/1.1 200 OK" _ TestNavigationAndMounts.test_registered_pages_render_successfully[/ui/sources] _ self = app_client = (, ) route_path = '/ui/sources' @pytest.mark.parametrize( "route_path", [ "/ui/homepage", "/ui/homepage/edit", "/ui/documents", "/ui/people", "/ui/sources", "/ui/jobs", ], ) def test_registered_pages_render_successfully(self, app_client, route_path: str): """Smoke test verifying all primary UI routes respond with 200 OK.""" _, client = app_client response = client.get(route_path) > assert response.status_code == 200 E assert 404 == 200 E + where 404 = .status_code tests\ui\test_navigation_and_mounts.py:42: AssertionError ---------------------------- Captured stdout call ----------------------------- 2026-08-05 18:31:13 WARNING | http://testserver/ui/sources not found 2026-08-05 18:31:13 INFO | HTTP Request: GET http://testserver/ui/sources "HTTP/1.1 404 Not Found" ------------------------------ Captured log call ------------------------------ WARNING nicegui:nicegui.py:180 http://testserver/ui/sources not found INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/sources "HTTP/1.1 404 Not Found" _________ TestPageRegistration.test_ui_mount_serves_registered_pages __________ self = app_client = (, ) def test_ui_mount_serves_registered_pages(self, app_client): """Mounted UI routes respond successfully when the full app is created.""" _, client = app_client homepage_response = client.get("/ui/homepage") upload_response = client.get("/ui/upload", follow_redirects=False) documents_response = client.get("/ui/documents") people_response = client.get("/ui/people") sources_response = client.get("/ui/sources") jobs_response = client.get("/ui/jobs") assert homepage_response.status_code == 200 assert upload_response.status_code == 307 assert documents_response.status_code == 200 assert people_response.status_code == 200 > assert sources_response.status_code == 200 E assert 404 == 200 E + where 404 = .status_code tests\ui\test_pages_registration.py:25: AssertionError ---------------------------- Captured stdout call ----------------------------- 2026-08-05 18:31:14 INFO | HTTP Request: GET http://testserver/ui/homepage "HTTP/1.1 200 OK" 2026-08-05 18:31:14 INFO | HTTP Request: GET http://testserver/ui/upload "HTTP/1.1 307 Temporary Redirect" 2026-08-05 18:31:14 INFO | HTTP Request: GET http://testserver/ui/documents "HTTP/1.1 200 OK" 2026-08-05 18:31:14 INFO | HTTP Request: GET http://testserver/ui/people "HTTP/1.1 200 OK" 2026-08-05 18:31:14 WARNING | http://testserver/ui/sources not found 2026-08-05 18:31:14 INFO | HTTP Request: GET http://testserver/ui/sources "HTTP/1.1 404 Not Found" 2026-08-05 18:31:14 INFO | HTTP Request: GET http://testserver/ui/jobs "HTTP/1.1 200 OK" ------------------------------ Captured log call ------------------------------ INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/homepage "HTTP/1.1 200 OK" INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/upload "HTTP/1.1 307 Temporary Redirect" INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/documents "HTTP/1.1 200 OK" INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/people "HTTP/1.1 200 OK" WARNING nicegui:nicegui.py:180 http://testserver/ui/sources not found INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/sources "HTTP/1.1 404 Not Found" INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/jobs "HTTP/1.1 200 OK" _______ TestSourcesPageRendering.test_sources_page_renders_empty_state ________ self = app_client = (, ) def test_sources_page_renders_empty_state(self, app_client): _, client = app_client response = client.get("/ui/sources") > assert response.status_code == 200 E assert 404 == 200 E + where 404 = .status_code tests\ui\test_sources_page.py:69: AssertionError ---------------------------- Captured stdout call ----------------------------- 2026-08-05 18:31:14 WARNING | http://testserver/ui/sources not found 2026-08-05 18:31:14 INFO | HTTP Request: GET http://testserver/ui/sources "HTTP/1.1 404 Not Found" ------------------------------ Captured log call ------------------------------ WARNING nicegui:nicegui.py:180 http://testserver/ui/sources not found INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/sources "HTTP/1.1 404 Not Found" _______ TestSourcesPageRendering.test_sources_page_lists_seeded_sources _______ self = app_client = (, ) @pytest.mark.asyncio async def test_sources_page_lists_seeded_sources(self, app_client): _, client = app_client async with session_scope() as session: document = Document(name="Source Document", document_type="letter") session.add(document) await session.flush() session.add( Source( document_id=document.id, page_number=1, upload_name="page_one.png", filename="stored_page_one.png", file_path="/tmp/stored_page_one.png", ) ) await session.commit() response = client.get("/ui/sources") > assert response.status_code == 200 E assert 404 == 200 E + where 404 = .status_code tests\ui\test_sources_page.py:94: AssertionError ---------------------------- Captured stdout call ----------------------------- 2026-08-05 18:31:14 WARNING | http://testserver/ui/sources not found 2026-08-05 18:31:14 INFO | HTTP Request: GET http://testserver/ui/sources "HTTP/1.1 404 Not Found" ------------------------------ Captured log call ------------------------------ WARNING nicegui:nicegui.py:180 http://testserver/ui/sources not found INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/sources "HTTP/1.1 404 Not Found" ___ TestSourcesPageRendering.test_sources_page_filters_to_document_context ____ self = app_client = (, ) @pytest.mark.asyncio async def test_sources_page_filters_to_document_context(self, app_client): _, client = app_client async with session_scope() as session: target = Document(name="Target", document_type="letter") other = Document(name="Other", document_type="record") session.add_all([target, other]) await session.flush() session.add_all( [ Source( document_id=target.id, page_number=1, upload_name="target_page.png", filename="target_stored.png", file_path="/tmp/target_stored.png", ), Source( document_id=other.id, page_number=1, upload_name="other_page.png", filename="other_stored.png", file_path="/tmp/other_stored.png", ), ] ) await session.commit() target_id = str(target.id) response = client.get(f"/ui/sources?document_id={target_id}") > assert response.status_code == 200 E assert 404 == 200 E + where 404 = .status_code tests\ui\test_sources_page.py:131: AssertionError ---------------------------- Captured stdout call ----------------------------- 2026-08-05 18:31:14 WARNING | http://testserver/ui/sources?document_id=14d8708a-ac52-49a0-b0ca-a19d6c2daca7 not found 2026-08-05 18:31:14 INFO | HTTP Request: GET http://testserver/ui/sources?document_id=14d8708a-ac52-49a0-b0ca-a19d6c2daca7 "HTTP/1.1 404 Not Found" ------------------------------ Captured log call ------------------------------ WARNING nicegui:nicegui.py:180 http://testserver/ui/sources?document_id=14d8708a-ac52-49a0-b0ca-a19d6c2daca7 not found INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/sources?document_id=14d8708a-ac52-49a0-b0ca-a19d6c2daca7 "HTTP/1.1 404 Not Found" ______ TestSourcesPageRendering.test_sources_page_filters_to_job_context ______ self = app_client = (, ) seed_job = ._seed at 0x000001EC8F3898A0> @pytest.mark.asyncio async def test_sources_page_filters_to_job_context(self, app_client, seed_job): _, client = app_client job_id = await seed_job(filename="job-page.png", transcription_text="job text") response = client.get(f"/ui/sources?job_id={job_id}") > assert response.status_code == 200 E assert 404 == 200 E + where 404 = .status_code tests\ui\test_sources_page.py:144: AssertionError ---------------------------- Captured stdout call ----------------------------- 2026-08-05 18:31:14 WARNING | http://testserver/ui/sources?job_id=f9aec457-1f4b-4081-b2cb-4dccae00afd5 not found 2026-08-05 18:31:14 INFO | HTTP Request: GET http://testserver/ui/sources?job_id=f9aec457-1f4b-4081-b2cb-4dccae00afd5 "HTTP/1.1 404 Not Found" ------------------------------ Captured log call ------------------------------ WARNING nicegui:nicegui.py:180 http://testserver/ui/sources?job_id=f9aec457-1f4b-4081-b2cb-4dccae00afd5 not found INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/sources?job_id=f9aec457-1f4b-4081-b2cb-4dccae00afd5 "HTTP/1.1 404 Not Found" _ TestSourcesPageRendering.test_sources_page_job_context_shows_job_source_status_and_error_detail _ self = app_client = (, ) seed_job = ._seed at 0x000001EC8F388AE0> @pytest.mark.asyncio async def test_sources_page_job_context_shows_job_source_status_and_error_detail( self, app_client, seed_job ): _, client = app_client job_id = await seed_job( filename="job-failed-page.png", status=JobStatus.FAILED, transcription_text=None, error_detail="Provider timed out", ) response = client.get(f"/ui/sources?job_id={job_id}") > assert response.status_code == 200 E assert 404 == 200 E + where 404 = .status_code tests\ui\test_sources_page.py:163: AssertionError ---------------------------- Captured stdout call ----------------------------- 2026-08-05 18:31:14 WARNING | http://testserver/ui/sources?job_id=82032e5d-847c-4147-9f5d-42e6e6aea6da not found 2026-08-05 18:31:14 INFO | HTTP Request: GET http://testserver/ui/sources?job_id=82032e5d-847c-4147-9f5d-42e6e6aea6da "HTTP/1.1 404 Not Found" ------------------------------ Captured log call ------------------------------ WARNING nicegui:nicegui.py:180 http://testserver/ui/sources?job_id=82032e5d-847c-4147-9f5d-42e6e6aea6da not found INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/sources?job_id=82032e5d-847c-4147-9f5d-42e6e6aea6da "HTTP/1.1 404 Not Found" _ TestSourcesPageRendering.test_source_detail_page_renders_preview_and_revision_box _ self = app_client = (, ) seed_job = ._seed at 0x000001EC8F38A8E0> @pytest.mark.asyncio async def test_source_detail_page_renders_preview_and_revision_box( self, app_client, seed_job ): _, client = app_client fixture_path = ( Path(__file__).resolve().parents[1] / "fixtures" / "images" / "valid" / "small_png.png" ) job_id = await seed_job( filename="detail-source.png", transcription_text="original transcription text", revision_text="human revision text", source_file=fixture_path, ) async with session_scope() as session: job = await session.get(Job, job_id) assert job is not None source = ( await session.exec(select(Source).where(Source.document_id == job.document_id)) ).first() assert source is not None source_id = str(source.id) response = client.get(f"/ui/sources/{source_id}") > assert response.status_code == 200 E assert 404 == 200 E + where 404 = .status_code tests\ui\test_sources_page.py:198: AssertionError ---------------------------- Captured stdout call ----------------------------- 2026-08-05 18:31:14 WARNING | http://testserver/ui/sources/07d47626-452c-4d25-93ee-63081d173d80 not found 2026-08-05 18:31:14 INFO | HTTP Request: GET http://testserver/ui/sources/07d47626-452c-4d25-93ee-63081d173d80 "HTTP/1.1 404 Not Found" ------------------------------ Captured log call ------------------------------ WARNING nicegui:nicegui.py:180 http://testserver/ui/sources/07d47626-452c-4d25-93ee-63081d173d80 not found INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/sources/07d47626-452c-4d25-93ee-63081d173d80 "HTTP/1.1 404 Not Found" _ TestSourcesPageRendering.test_source_delete_page_blocks_when_source_is_job_linked _ self = app_client = (, ) seed_job = ._seed at 0x000001EC8F3893A0> @pytest.mark.asyncio async def test_source_delete_page_blocks_when_source_is_job_linked( self, app_client, seed_job ): _, client = app_client job_id = await seed_job(filename="linked-source.png", transcription_text="linked text") async with session_scope() as session: job = await session.get(Job, job_id) assert job is not None source = ( await session.exec(select(Source).where(Source.document_id == job.document_id)) ).first() assert source is not None source_id = str(source.id) response = client.get(f"/ui/sources/{source_id}/delete") > assert response.status_code == 200 E assert 404 == 200 E + where 404 = .status_code tests\ui\test_sources_page.py:223: AssertionError ---------------------------- Captured stdout call ----------------------------- 2026-08-05 18:31:14 WARNING | http://testserver/ui/sources/2ddbd90f-bd65-4e28-b297-4d3288e8ba71/delete not found 2026-08-05 18:31:14 INFO | HTTP Request: GET http://testserver/ui/sources/2ddbd90f-bd65-4e28-b297-4d3288e8ba71/delete "HTTP/1.1 404 Not Found" ------------------------------ Captured log call ------------------------------ WARNING nicegui:nicegui.py:180 http://testserver/ui/sources/2ddbd90f-bd65-4e28-b297-4d3288e8ba71/delete not found INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/sources/2ddbd90f-bd65-4e28-b297-4d3288e8ba71/delete "HTTP/1.1 404 Not Found" ___ TestSourcesPageRendering.test_source_delete_page_allows_unlinked_source ___ self = app_client = (, ) @pytest.mark.asyncio async def test_source_delete_page_allows_unlinked_source(self, app_client): _, client = app_client async with session_scope() as session: document = Document(name="Unlinked Source Doc", document_type="memo") session.add(document) await session.flush() source = Source( document_id=document.id, page_number=1, upload_name="orphan-source.png", filename="orphan-source.png", file_path="/tmp/orphan-source.png", ) session.add(source) await session.commit() source_id = str(source.id) response = client.get(f"/ui/sources/{source_id}/delete") > assert response.status_code == 200 E assert 404 == 200 E + where 404 = .status_code tests\ui\test_sources_page.py:248: AssertionError ---------------------------- Captured stdout call ----------------------------- 2026-08-05 18:31:14 WARNING | http://testserver/ui/sources/06c535f3-7e98-4536-b138-d1730f931933/delete not found 2026-08-05 18:31:14 INFO | HTTP Request: GET http://testserver/ui/sources/06c535f3-7e98-4536-b138-d1730f931933/delete "HTTP/1.1 404 Not Found" ------------------------------ Captured log call ------------------------------ WARNING nicegui:nicegui.py:180 http://testserver/ui/sources/06c535f3-7e98-4536-b138-d1730f931933/delete not found INFO httpx2:_client.py:1090 HTTP Request: GET http://testserver/ui/sources/06c535f3-7e98-4536-b138-d1730f931933/delete "HTTP/1.1 404 Not Found" =========================== short test summary info =========================== FAILED tests/ui/test_documents_page.py::TestDocumentsPageRendering::test_document_detail_page_renders_bento_grid_and_metadata FAILED tests/ui/test_jobs_page.py::TestJobsPageRendering::test_job_detail_page_renders_logistics_and_links FAILED tests/ui/test_navigation_and_mounts.py::TestNavigationAndMounts::test_registered_pages_render_successfully[/ui/sources] FAILED tests/ui/test_pages_registration.py::TestPageRegistration::test_ui_mount_serves_registered_pages FAILED tests/ui/test_sources_page.py::TestSourcesPageRendering::test_sources_page_renders_empty_state FAILED tests/ui/test_sources_page.py::TestSourcesPageRendering::test_sources_page_lists_seeded_sources FAILED tests/ui/test_sources_page.py::TestSourcesPageRendering::test_sources_page_filters_to_document_context FAILED tests/ui/test_sources_page.py::TestSourcesPageRendering::test_sources_page_filters_to_job_context FAILED tests/ui/test_sources_page.py::TestSourcesPageRendering::test_sources_page_job_context_shows_job_source_status_and_error_detail FAILED tests/ui/test_sources_page.py::TestSourcesPageRendering::test_source_detail_page_renders_preview_and_revision_box FAILED tests/ui/test_sources_page.py::TestSourcesPageRendering::test_source_delete_page_blocks_when_source_is_job_linked FAILED tests/ui/test_sources_page.py::TestSourcesPageRendering::test_source_delete_page_allows_unlinked_source ======================== 12 failed, 40 passed in 3.81s ========================