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
This might just be something on my end, but i can not get to the bottom of this. I've gone through the documentation, gone through google, github and stackoverflow threads for something similiar but could not find nothing, also tried to implement just a simple testcase for this behaviour, but it still occurs.
I know i could get past it by using #ignore, or by not using the strict mode, but i would rather understand the problem, and where it is coming from.
Testcase straight from the docs, while using python 3.10 and pytest_httpserver 1.1.0
import requests
from pytest_httpserver import HTTPServer
def test_json_client(httpserver: HTTPServer):
httpserver.expect_request("/foobar") # Error occurs here already
httpserver.expect_request("/foobar").respond_with_json({"foo": "bar"}) # This line errors on both functions
assert requests.get(httpserver.url_for("/foobar")).json() == {"foo": "bar"}
Type of "respond_with_json" is partially unknown
Type of "respond_with_json" is "(response_json: Unknown, status: int = 200, headers: Mapping[str, str] | None = None, content_type: str = "application/json") -> None"Pylance[reportUnknownMemberType](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportUnknownMemberType)
I would appreciate if someone had a better understanding about this and could explain to me why this is happening, or is this something that is expected, or something to be fixed at some point?
The text was updated successfully, but these errors were encountered:
Thanks for the report, I had no time to look at it closely yet but for the first sight I think the issue is with the (few) Unknown types in the function parameters.
Were you able to reproduce this with a command line or do you get it from your IDE?
In case of the command line, could you share it? Just to be on the same page.
This might just be something on my end, but i can not get to the bottom of this. I've gone through the documentation, gone through google, github and stackoverflow threads for something similiar but could not find nothing, also tried to implement just a simple testcase for this behaviour, but it still occurs.
I know i could get past it by using #ignore, or by not using the strict mode, but i would rather understand the problem, and where it is coming from.
Testcase straight from the docs, while using python 3.10 and pytest_httpserver 1.1.0
error that comes up:
and
I would appreciate if someone had a better understanding about this and could explain to me why this is happening, or is this something that is expected, or something to be fixed at some point?
The text was updated successfully, but these errors were encountered: