httpx

3 posts tagged “httpx”.

  1. 2025
  2. How to mock httpx using pytest-mock

    I wrote this test to exercise some httpx code today, using pytest-mock. The key was to use which patches the module that was imported by the module.

    1 min read
  3. 2023
  4. Logging OpenAI API requests and responses using HTTPX

    My LLM tool has a feature where you can set a environment variable to see full debug level details of any HTTP requests it makes to the OpenAI APIs.

    2 min read
  5. A tip for debugging pytest-httpx

    I use pytest-httpx in a bunch of my projects. Occasionally I run into test failures like this one, which can sometimes be really hard to figure out: Today I figured out a pattern for investigating…

    1 min read