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
SanicTestClient throws error with response.text(...) #1703
Comments
A simple quickfix would be to import |
@wochinge Hi Tobias, mind if I ask what are you using the |
Hi @harshanarayana What speaks against using the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions. |
Trying to revive the discussion since I am currently facing the same issue. I'm not explicitly calling I this case, the proposed solution of importing the JSONDecodeError from simplejson ( @wochinge Did you solve the issue in some way? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions. |
Describe the bug
When an endpoint does not return a json und we are using the
SanicTestClient
, it gives an error:This is because
sanic.testing
importJSONDecodeError
fromjson
, butrequests
(used byrequests_async
) usessimplejson
, which means that thisdoes not work cause it does not handle the actual type
simplejson.errors.JSONDecodeError
Code snippet
Endpoint:
Request:
Expected behavior
No error.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: