Test pytest.skip in doctest

This commit is contained in:
Takafumi Arakaki 2019-03-15 11:06:57 +09:00
parent 43aee15ba3
commit fa3cca51e1
1 changed files with 12 additions and 0 deletions

View File

@ -188,6 +188,18 @@ class TestDoctests(object):
]
)
def test_doctest_skip(self, testdir):
testdir.maketxtfile(
"""
>>> 1
1
>>> import pytest
>>> pytest.skip("")
"""
)
result = testdir.runpytest("--doctest-modules")
result.stdout.fnmatch_lines(["*1 skipped*"])
def test_docstring_partial_context_around_error(self, testdir):
"""Test that we show some context before the actual line of a failing
doctest.