From fa3cca51e15b373d9bac567bca1fb941e96302f8 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Fri, 15 Mar 2019 11:06:57 +0900 Subject: [PATCH] Test pytest.skip in doctest --- testing/test_doctest.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/testing/test_doctest.py b/testing/test_doctest.py index e7b6b060f..09f7c331d 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -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.