Skip to content

Commit d5a70ac

Browse files
committed
Simplify test in test_doctest_report_none_or_only_first_failure.
1 parent f8f690d commit d5a70ac

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

testing/test_doctest.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -840,21 +840,21 @@ def test_doctest_report_ndiff(self, testdir):
840840
' 2 3 6',
841841
])
842842

843-
def test_doctest_report_none_or_only_first_failure(self, testdir):
844-
for format in 'none', 'only_first_failure':
845-
result = self._run_doctest_report(testdir, format)
846-
result.stdout.fnmatch_lines([
847-
'Expected:',
848-
' a b',
849-
' 0 1 4',
850-
' 1 2 4',
851-
' 2 3 6',
852-
'Got:',
853-
' a b',
854-
' 0 1 4',
855-
' 1 2 5',
856-
' 2 3 6',
857-
])
843+
@pytest.mark.parametrize('format', ['none', 'only_first_failure'])
844+
def test_doctest_report_none_or_only_first_failure(self, testdir, format):
845+
result = self._run_doctest_report(testdir, format)
846+
result.stdout.fnmatch_lines([
847+
'Expected:',
848+
' a b',
849+
' 0 1 4',
850+
' 1 2 4',
851+
' 2 3 6',
852+
'Got:',
853+
' a b',
854+
' 0 1 4',
855+
' 1 2 5',
856+
' 2 3 6',
857+
])
858858

859859
def test_doctest_report_invalid(self, testdir):
860860
result = self._run_doctest_report(testdir, 'obviously_invalid_format')

0 commit comments

Comments
 (0)