Closed
Description
My goal: enforce disallow_untyped_defs
in my application but not in my tests.
Here's my setup:
mypy.ini
app
├── __init__.py
└── app.py
tests
├── __init__.py
├── subdir
│ └── test_two.py
└── test_one.py
The important contents:
# tests/test_one.py
def test_one():
pass
# tests/subdir/test_two.py
def test_two():
pass
And either of these two mypy.ini
files:
[mypy]
disallow_untyped_defs = true
[mypy-tests.*]
disallow_untyped_defs = false
[mypy]
disallow_untyped_defs = true
[mypy-tests.*]
disallow_untyped_defs = false
[mypy-tests.subdir.*]
disallow_untyped_defs = false
I expect this command to produce no errors:
$ mypy app/__init__.py app/app.py tests/__init__.py tests/subdir/test_two.py tests/test_one.py
tests/subdir/test_two.py:1: error: Function is missing a type annotation
version info
$ mypy --version
mypy 0.620
CC @ethanhs since we chatted about this in IRC/slack
Metadata
Metadata
Assignees
Labels
No labels