vinissimus / async-asgi-testclient

A framework-agnostic library for testing ASGI web applications
MIT License
160 stars 20 forks source link

Switch to requests-async? #7

Closed florimondmanca closed 5 years ago

florimondmanca commented 5 years ago

Hi! Thanks for this project. I think it's a good way forward to have a framework-agnostic async test client for ASGI apps.

I see the client currently uses requests — would it make sense to switch to requests-async?

I don't think it'll provide any functional changes and maybe this will just be a maintenance cost. I'm just throwing the idea off my head. :-)

masipcat commented 5 years ago

Hi @florimondmanca !

Currently we're using requests just for the Response class and we aren't using (almost) any other logic that provides the library. It seems that requests-async is a wrapper around requests and has implemented its own ASGI TestClient. Looking at tests it seems that their TestClient supports all operations except response streams (we have Request/Response streams WIP! https://github.com/vinissimus/async-asgi-testclient/pull/6) and this is why we reimplemented some methods of Response class. So I don't think that using request-async would simplify async-asgi-testclient at this moment.

Correct me if I'm missing something ;)

Thank you

florimondmanca commented 5 years ago

Ah, I see. I looked at the code here and I see how requests is mostly used for its models, not to actually run requests. Thanks! I think we can close this.