-
-
Notifications
You must be signed in to change notification settings - Fork 863
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
Type-checking our tests #650
Comments
Alternatively, we could tweak the [mypy]
files = httpx, tests
ignore_missing_imports = True
disallow_untyped_defs = False
check_untyped_defs = True
[mypy-httpx]
disallow_untyped_defs = True
check_untyped_defs = False Running this locally raises 141 errors, but mostly on internal APIs, so, hmm. |
I think this is a great idea, would like to work on this. Since I am pretty new to httpx, adding these type hints to the tests will give me a better picture of how httpx works under the hood. |
I think this is still a good idea, though it's a bit of busy work to upgrade our existing test code. Let's perhaps just remind ourselves to add types whenever we add/touch existing tests? |
@florimondmanca I see a lot of merged PR. I guess you should close this ? 😄 |
I think there’s one small last step which would be to add tests/ to the mypy arguments in the check script. :-) Once this is enforced then yup, we can close this off. |
I am currently working on a different Good First Issue PR and when that is done. I would be happy to pick up what's remaining in this PR so we can close this one too. 😄 |
I know this is not a standard thing to do across Encode projects, but I've been wondering if it would be worth starting to type-hint our tests.
I've seen at least two instances of this recently:
My rationale is based on two aspects:
The main counter-argument, I suppose, is that type hinting tests is tedious. I think that's fair, but I believe the two pro's above make it compelling.
Thoughts?
The text was updated successfully, but these errors were encountered: