Skip to content

Commit fa3cca5

Browse files
committed
Test pytest.skip in doctest
1 parent 43aee15 commit fa3cca5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

testing/test_doctest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,18 @@ def test_doctest_unexpected_exception(self, testdir):
188188
]
189189
)
190190

191+
def test_doctest_skip(self, testdir):
192+
testdir.maketxtfile(
193+
"""
194+
>>> 1
195+
1
196+
>>> import pytest
197+
>>> pytest.skip("")
198+
"""
199+
)
200+
result = testdir.runpytest("--doctest-modules")
201+
result.stdout.fnmatch_lines(["*1 skipped*"])
202+
191203
def test_docstring_partial_context_around_error(self, testdir):
192204
"""Test that we show some context before the actual line of a failing
193205
doctest.

0 commit comments

Comments
 (0)