You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I apologize if an issue is an inappropriate way to discuss this, but the only discussion location I could find on aiohttp was the discus forum which was conspicuously empty.
I'm creating a project using aiohttp to make HTTP requests to remote servers. I'd like to test this project. This means I need a way to essentially mock out HTTP requests during testing so I don't actually attempt to talk to these remote servers. I've used HTTPretty in the past, which I'm very fond of. It does not work with asyncio and there's non-trivial work to get it to work. I see that aiohttp has a test suite for itself, but I have not been able to find any tools for writing tests that mock/patch aiohttp itself so I can assert that the correct requests will be made to the expected locations or that errors are properly handled. Does such tooling exist? If not, would it be appropriate to add something like a FakeTransport/FakeConnector into aiohttp that could be used to capture requests and supply pre-canned responses? I may be interesting in writing it, if so, but I want to make sure that would be something reasonable and get ideas for a good approach as I'm just getting started reading the code.
The text was updated successfully, but these errors were encountered:
I apologize if an issue is an inappropriate way to discuss this, but the only discussion location I could find on aiohttp was the discus forum which was conspicuously empty.
I'm creating a project using aiohttp to make HTTP requests to remote servers. I'd like to test this project. This means I need a way to essentially mock out HTTP requests during testing so I don't actually attempt to talk to these remote servers. I've used HTTPretty in the past, which I'm very fond of. It does not work with asyncio and there's non-trivial work to get it to work. I see that aiohttp has a test suite for itself, but I have not been able to find any tools for writing tests that mock/patch aiohttp itself so I can assert that the correct requests will be made to the expected locations or that errors are properly handled. Does such tooling exist? If not, would it be appropriate to add something like a FakeTransport/FakeConnector into aiohttp that could be used to capture requests and supply pre-canned responses? I may be interesting in writing it, if so, but I want to make sure that would be something reasonable and get ideas for a good approach as I'm just getting started reading the code.
The text was updated successfully, but these errors were encountered: