Skip to content

Commit

Permalink
Start running mypy on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DMRobertson committed Dec 22, 2021
1 parent 0edfb49 commit 04b6b88
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions pyproject.toml
Expand Up @@ -39,7 +39,13 @@ warn_unreachable = true
no_implicit_reexport = true
strict_equality = true

files = ["src/nacl"]
files = [
"src/nacl",
"tests.test_aead",
"tests.test_bindings",
"tests.test_box",
"tests.test_signing",
]

[[tool.mypy.overrides]]
module = [
Expand All @@ -51,7 +57,7 @@ ignore_missing_imports = true
# nacl._sodium return `Any` as far as mypy is concerned. It's not worth it to
# stub the C functions or cast() their uses. But this means there are more
# `Any`s floating around. So the more restrictive any checks we'd like to use
# should only be turned out outside of `bindings`.
# should only be turned on outside of `bindings`.

[[tool.mypy.overrides]]
module = [
Expand All @@ -60,3 +66,23 @@ module = [
disallow_any_expr = false
warn_return_any = false

# Loosen some of the checks within the tests.
# For now this is an explicit list rather than a wildcard "test.*", to make
# it a little easier to run the strict checks on modules first. We can clean
# this up later.

[[tool.mypy.overrides]]
module = [
"tests.test_aead",
"tests.test_bindings",
"tests.test_box",
"tests.test_signing",
]
# Some library helpers types' involve `Any`, in particular `pytest.mark.parameterize`
# and `hypothesis.strategies.sampledfrom`.
disallow_any_expr = false
disallow_any_decorated = false

# It's not useful to annotate each test function as `-> None`.
disallow_untyped_defs = false
disallow_incomplete_defs = false

0 comments on commit 04b6b88

Please sign in to comment.