The following test uses mypy to check the correctness of Python code using
typing, largely introduced in 3.5 and 3.6.
The two tests check all package code and all test code in the tests
directory, respectively.
Testing frameworks such as 'nose2' will automatically run the tests and will fail if any typing error
is detected (see step #3 below for more on this).
- Add the file below to your
tests
directory, which should be at the top-level in your repository alongside your module directory. - Modify the first line in
__init__
that setsself.pkgname
to match your library's package name. This assumes one package per repo, so the test would need to be changed if this isn't how the repo structure works.