On Sun, Jun 28, 2026 at 08:51:11PM +0000, Santiago Vila wrote:
During a rebuild of all packages in unstable, this package failed to build.
[...]
_____________________________ test_logging_request _____________________________

server = <tests.conftest.TestServer object at 0x7f99220d4050>
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f99220d6e40>

   def test_logging_request(server, caplog):
       caplog.set_level(logging.INFO)
       with httpx.Client() as client:
           response = client.get(server.url)
           assert response.status_code == 200

      assert caplog.record_tuples == [
           (
               "httpx",
               logging.INFO,
               'HTTP Request: GET http://127.0.0.1:8000/ "HTTP/1.1 200 OK"',
           )
       ]
E       assert [('uvicorn.ac...1.1 200 OK"')] == [('httpx', 20...1.1 200 OK"')]
E
E         At index 0 diff: ('uvicorn.access', 20, '127.0.0.1:52530 - "GET / HTTP/1.1" 
200') != ('httpx', 20, 'HTTP Request: GET http://127.0.0.1:8000/ "HTTP/1.1 200 OK"')
E         Left contains one more item: ('httpx', 20, 'HTTP Request: GET 
http://127.0.0.1:8000/ "HTTP/1.1 200 OK"')
E
E         Full diff:
E           [
E         +     (...
E
E         ...Full output truncated (10 lines hidden), use '-vv' to show

tests/test_utils.py:59: AssertionError

I bisected this and found:

bisection finished successfully
  last good timestamp: 20260620T082722Z
  first bad timestamp: 20260620T142830Z
only one package differs: python3-pytest 9.0.3-1 -> 9.1.1-1

The same is true upstream: I can reproduce it there by building a virtual environment from requirements.txt, upgrading pytest to 9.1.0, and running `pytest tests/test_utils.py`.

This change from the pytest changelog looks like a likely reason:

  #3697: Logging capture now works for non-propagating loggers. Previously only 
logs which reached the root logger were captured. This includes caplog and the 
“Captured log calls” test reporting.

--
Colin Watson (he/him)                              [[email protected]]

Reply via email to