Skip to content

requests.Session(trust_env=False) prevents responses from intercepting HTTP requests #799

Description

@ikus060

When creating a requests.Session with trust_env=False, the responses library fails to intercept the HTTP requests as expected. The request appears to bypass the mock entirely and attempts a real network call instead.
This behavior is not documented anywhere in the responses README or official documentation. It is unclear whether this is:

  • A known limitation
  • An intended behavior
  • A bug

Kindly requesting either a fix or at minimum clear documentation of this interaction.

Metadata

Metadata

Assignees

No one assigned

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions