Skip to content

Commit

Permalink
using @pytest.mark.parametrize instead of calling one test many times…
Browse files Browse the repository at this point in the history
… from another as suggested by @nicoddemus in pr #1754
  • Loading branch information
hartym committed Jul 23, 2016
1 parent ec7695e commit e229a27
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions testing/test_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,8 @@ def foo():
""")
return testdir.runpytest("--doctest-modules", "--doctest-report", format)

def test_doctest_report_udiff(self, testdir, format='udiff'):
@pytest.mark.parametrize('format', ['udiff', 'UDIFF', 'uDiFf'])
def test_doctest_report_udiff(self, testdir, format):
result = self._run_doctest_report(testdir, format)
result.stdout.fnmatch_lines([
' 0 1 4',
Expand Down Expand Up @@ -855,10 +856,6 @@ def test_doctest_report_none_or_only_first_failure(self, testdir):
' 2 3 6',
])

def test_doctest_report_case_insensitive(self, testdir):
for format in 'udiff', 'UDIFF', 'uDiFf':
self.test_doctest_report_udiff(testdir, format)

def test_doctest_report_invalid(self, testdir):
result = self._run_doctest_report(testdir, 'obviously_invalid_format')
result.stderr.fnmatch_lines([
Expand Down

0 comments on commit e229a27

Please sign in to comment.