-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the right type on Response for tests #139
Use the right type on Response for tests #139
Conversation
@@ -100,7 +101,7 @@ def get_response(client: TestClient, path: str) -> Response: | |||
return response | |||
|
|||
|
|||
def assert_is_not_multiprocess(response: Response) -> None: | |||
def assert_is_not_multiprocess(response: TestClientResponse) -> None: | |||
assert response.status_code == 200 | |||
assert b"Multiprocess" not in response.content | |||
assert b"# HELP process_cpu_seconds_total" in response.content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line of code doesn't pass locally... Which is incredibly annoying.
Hey @Kludex, thanks for your contribution efforts. Generally I'm open towards switching to a pure ASGI implementation. But sadly I can't support you with the implementation because I lack knowledge regarding ASGI and async Python in general. Can you tell me what the advantage of switching to an ASGI implementation? |
Some tests are failing. It seems like something about the way paths / handlers are exposed has changed. For example this test is failing. I think it is due to the instrumentator not passing all parameters to the middleware. Looking at |
Unrelated this this PR: just FYI I couldn't get tests to run on an M1 Mac, I had to run them in a Docker container. |
Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
Codecov Report
@@ Coverage Diff @@
## master #139 +/- ##
==========================================
- Coverage 93.84% 93.53% -0.31%
==========================================
Files 9 10 +1
Lines 893 928 +35
==========================================
+ Hits 838 868 +30
- Misses 55 60 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
🎉 This PR is included in version 5.8.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Thanks 👍 |
I didn't notice the title was wrong 😅 |
Niceee! Thanks for this! 🙇 |
Changes
starlette.responses.Response
byrequests.Response
on tests, as it's the right type returned byTestClient
.BaseHTTPMiddleware
to pure ASGI.Can you approve the pipeline @trallnag ? cc @tiangolo - Some tests still failing atm.