Closed davetapley closed 9 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
4910dd7
) 100.00% compared to head (9c86b93
) 100.00%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks, the CI has some failing tests, can you fix them too?
@CaselIT this turned out to be more complicated because of:
That breaks my naive typing, because simulate_request
could return StreamedResult
.
I could change to -> Union[Result, StreamedResult]
,
but that doesn't help for #2207 because StreamedResult
doesn't implement text
or json
(but does explain why it was _ResultBase
in the first place).
However: StreamedResult
can only be returned from _simulate_request_asgi
,
so it would be nice (for my purposes) if I could narrow to just Result
(since I'm using WSGI).
I thought I could hint my way around it by adding a TypeGuard
to:
But that doesn't work because an ASGIApp
is a WSGIApp
😞
And that led me to realize that what I want on #2207 (text
and json
) isn't possible so long as:
ASGIApp
is (i.e. subclasses) a WSGIApp
, and:simulate_get
, etc. functions to work transparently with WSGI or ASGI applications, because:In light of that I'm going to close this and #2207, and open a new discussion to address the underlying issue.
let me try something
I can't seem to be able to push an update. I'll create a new PR
Fixes https://github.com/falconry/falcon/issues/2207