-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Run mypy on our tests again #7909
Copy link
Copy link
Closed
Labels
area: code healtharea: testingarea: toolingpriority: significantIssues with higher than average priority that do not need to be in the current milestone.Issues with higher than average priority that do not need to be in the current milestone.
Metadata
Metadata
Assignees
Labels
area: code healtharea: testingarea: toolingpriority: significantIssues with higher than average priority that do not need to be in the current milestone.Issues with higher than average priority that do not need to be in the current milestone.
Similarly to #7908, when we moved our tests out of our packages, we accidentally stopped running
mypyon them. Getting mypy to run on the tests won't be an issue, but if we run it as is, we start to hit errors. The first level of these, which causesmypyto print an error and stop running, is the duplicate named files (for example,acme/tests/client_test.pyandcertbot/tests/client_test.py). A way to fix that would be to run a small script that runsmypyindividual on each directory and/or module. But a complication here is that many of the files depend onacme/acme/magic_typing.py, and will print errors when not run alongsideacme/acme. Hardcoding that in would be a bit of a hack, so a better solution is probably to deprecatemagic_typingby no longer doing any Python 2.7-style mypy support in our codebase (also see #7806).If we choose to go ahead with option 2 from #7908, that may solve at least some of the issues (probably the ones around naming, since those weren't a problem before we reorganized the tests and removed the
__init__.pys). But there are some other issues to deal with.An initial attempt at dealing with all of this was made on the run-all-mypy branch, but that is probably not actually the best way to move forward here.