Run type checks only against packaged *.py files

- for tests/ and the noxfile.py, type annotations are not strictly
  enforced any more
  + this simplifies the way test cases and nox sessions are written
  + for many pytest fixtures, no types are available via a public API
- put fixtures inside the classes the corresponding test cases are
  grouped in
This commit is contained in:
Alexander Hess 2020-08-04 22:57:55 +02:00
commit 8586db58c7
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
4 changed files with 57 additions and 64 deletions

View file

@ -96,6 +96,8 @@ extend-ignore =
per-file-ignores =
noxfile.py:
# Type annotations are not strictly enforced.
ANN0, ANN2,
# TODO (isort): Check if still too many module members.
WPS202,
# TODO (isort): Remove after simplifying the nox session "lint".
@ -103,6 +105,8 @@ per-file-ignores =
# No overuse of string constants (e.g., '--version').
WPS226,
tests/*.py:
# Type annotations are not strictly enforced.
ANN0, ANN2,
# `assert` statements are ok in the test suite.
S101,
# Shadowing outer scopes occurs naturally with mocks.
@ -177,7 +181,7 @@ single_line_exclusions = typing
[mypy]
cache_dir = .cache/mypy
[mypy-nox.*,packaging.*,pytest,_pytest.*]
[mypy-nox.*,packaging,pytest]
ignore_missing_imports = true