Skip to content

Commit 44a726c

Browse files
authored
Merge pull request #97 from dmtucker/setup-cfg
Add test_setup_cfg
2 parents 551f25c + 5605e5d commit 44a726c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_pytest_mypy.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,3 +316,20 @@ def pytest_configure(config):
316316
'*/bad.py:2: error: Incompatible return value*',
317317
])
318318
assert result.ret != 0
319+
320+
321+
def test_setup_cfg(testdir, xdist_args):
322+
"""Ensure that the plugin allows configuration with setup.cfg."""
323+
testdir.makefile('.cfg', setup='''
324+
[mypy]
325+
disallow_untyped_defs = True
326+
''')
327+
testdir.makepyfile(conftest='''
328+
def pyfunc(x):
329+
return x * 2
330+
''')
331+
result = testdir.runpytest_subprocess('--mypy', *xdist_args)
332+
result.stdout.fnmatch_lines([
333+
'1: error: Function is missing a type annotation',
334+
])
335+
assert result.ret != 0

0 commit comments

Comments
 (0)