Skip to content

Commit b84c5cd

Browse files
committed
Run more than one test in test_mypy_success
1 parent 6c3d3ab commit b84c5cd

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

tests/test_pytest_mypy.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1-
def test_mypy_success(testdir):
1+
import pytest
2+
3+
4+
@pytest.mark.parametrize('test_count', [1, 2])
5+
def test_mypy_success(testdir, test_count):
26
"""Verify that running on a module with no type errors passes."""
3-
testdir.makepyfile('''
4-
def myfunc(x: int) -> int:
5-
return x * 2
6-
''')
7+
testdir.makepyfile(
8+
**{
9+
'test_' + str(test_i): '''
10+
def myfunc(x: int) -> int:
11+
return x * 2
12+
'''
13+
for test_i in range(test_count)
14+
}
15+
)
716
result = testdir.runpytest_subprocess()
817
result.assert_outcomes()
918
result = testdir.runpytest_subprocess('--mypy')
10-
result.assert_outcomes(passed=1)
19+
result.assert_outcomes(passed=test_count)
1120
assert result.ret == 0
1221

1322

0 commit comments

Comments
 (0)