-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
Allow user to pass in a custom resolve info context type (#213) #214
Conversation
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.
Can you also add a test that serves as a usage example, like above in the description.
You can simulate a type error with a "type: ignore" comment. It should say "unnecessary type ignore" if there is no type error.
How did you actually produce that type error? I tried with mypy 1.8, but couldn't reproduce it. Update: I can reproduce it now, but not if I use a type alias. I need to specify the type directly. Seems you used Pylance, right? |
ae97307
to
1751563
Compare
1751563
to
97f8fed
Compare
No, the error came from
|
Is there already a test in the codebase that does something similar, which I can use as an example? |
Makes sense since Pylance is based on Pyright. |
The idea is to add a test that serves as a usage example and where running the test or type checking of the test code would fail if you revert the change in this PR. Instead of a comment like "# this gives an error" you would simply write "# type: ignore". This comment tells type checkers like pyright or mypy to ignore the typing error, so that the type checking that is also run on the test code would not fail. On the other hand, if there is not the expected type error, mypy is configured to report a superfluous "type: ignore" comment. You can test everything with tox and the included tox.ini file. But you can also leave the tests to me, no problem. |
Yeah, if you could add the test, that'd be great. Thanks for the help on this! |
Usage example: