We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c3d3ab commit b84c5cdCopy full SHA for b84c5cd
tests/test_pytest_mypy.py
@@ -1,13 +1,22 @@
1
-def test_mypy_success(testdir):
+import pytest
2
+
3
4
+@pytest.mark.parametrize('test_count', [1, 2])
5
+def test_mypy_success(testdir, test_count):
6
"""Verify that running on a module with no type errors passes."""
- testdir.makepyfile('''
- def myfunc(x: int) -> int:
- return x * 2
- ''')
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
+ )
16
result = testdir.runpytest_subprocess()
17
result.assert_outcomes()
18
result = testdir.runpytest_subprocess('--mypy')
- result.assert_outcomes(passed=1)
19
+ result.assert_outcomes(passed=test_count)
20
assert result.ret == 0
21
22
0 commit comments