Skip to content

Question / feature request: using truesocket recording mode for an in-process HTTP server #198

@jayaddison

Description

@jayaddison

Hi again @mindflayer - thanks for your responses in sphinx-doc/sphinx#11324.

To recap (and for future readers): the improvement requested in that issue is to allow Sphinx to use session-based (pooled) HTTP requests instead of creating one TCP connection per request when it checks documentation hyperlinks. While investigating how to add tests for an implementation of that, I discovered mocket.

It turned out that mocket wasn't applicable for the implementation I attempted, because I wanted to retain both the test HTTP server and test HTTP client. In that plan, measurement of actual traffic from client to server was required, instead of what mocket generally provides: mocking of the server's responses (useful -- and in fact preferable -- in many other situations).

With that explained, the question / feature request is:

Would it be possible for mocket's recording mode to support a socket server that is in the same Python process as the socket client?

If helpful: I can provide example code that I've attempted this with, and the error output(s) that I've encountered. But I think I should ask the feasibility question first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions