From d5a70acd480f182fe77bf232508f3be862e516ff Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Sat, 23 Jul 2016 15:58:13 +0200 Subject: [PATCH] Simplify test in test_doctest_report_none_or_only_first_failure. --- testing/test_doctest.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/testing/test_doctest.py b/testing/test_doctest.py index c31098483..4ea2cc58e 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -840,21 +840,21 @@ class TestDoctestReportingOption: ' 2 3 6', ]) - def test_doctest_report_none_or_only_first_failure(self, testdir): - for format in 'none', 'only_first_failure': - result = self._run_doctest_report(testdir, format) - result.stdout.fnmatch_lines([ - 'Expected:', - ' a b', - ' 0 1 4', - ' 1 2 4', - ' 2 3 6', - 'Got:', - ' a b', - ' 0 1 4', - ' 1 2 5', - ' 2 3 6', - ]) + @pytest.mark.parametrize('format', ['none', 'only_first_failure']) + def test_doctest_report_none_or_only_first_failure(self, testdir, format): + result = self._run_doctest_report(testdir, format) + result.stdout.fnmatch_lines([ + 'Expected:', + ' a b', + ' 0 1 4', + ' 1 2 4', + ' 2 3 6', + 'Got:', + ' a b', + ' 0 1 4', + ' 1 2 5', + ' 2 3 6', + ]) def test_doctest_report_invalid(self, testdir): result = self._run_doctest_report(testdir, 'obviously_invalid_format')