Filter caplog to httpx2 records and require pytest >= 9.1

Merged
HR
4mo ago
+9-7

Summary

pytest 9.1.0 (gh#pytest-dev/pytest#3697) now captures log records from non-propagating loggers, causing uvicorn.access records to appear in caplog.record_tuples. Filter to only httpx2 records in assertions.

Assisted-by: Claude Opus 4.6

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.