Excluding Tests for Verify Types #3770
Replies: 1 comment 1 reply
-
Why would you would want to include a While you could exclude a directory called So I recommend that you remove |
Beta Was this translation helpful? Give feedback.
-
Why would you would want to include a While you could exclude a directory called So I recommend that you remove |
Beta Was this translation helpful? Give feedback.
-
Following typed library documentation and using pyright --verifytype, I learned that for one of my libraries many of the errors came from tests folders. The suggestion there is,
If your package includes tests or sample code, consider removing them from the distribution. If there is good reason to include them, consider placing them in a directory that begins with an underscore so they are not considered part of your library’s interface.
and that does work to rename all tests -> _tests. It is some churn and I think folders named test/tests are fairly common practice. Could rule either automatically exclude those or could rule be configurable with list of exclusions for verifytypes?
There is an exclude setting, but while I don't want tests treated as public api, I do still expect to CI check that there's no type errors in them. Maybe non_public/exclude_library setting?
Beta Was this translation helpful? Give feedback.
All reactions