From bf2f2dc2a64ce080244fa4abb2a7ace039af6c9b Mon Sep 17 00:00:00 2001 From: Holger Peters Date: Wed, 8 Oct 2014 15:54:08 +0200 Subject: [PATCH] Add a doctest for module docstrings --- testing/test_doctest.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/testing/test_doctest.py b/testing/test_doctest.py index d33f61150..aa1795874 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -323,3 +323,29 @@ class TestDoctests: """) reprec = testdir.inline_run(p, "--doctest-modules") reprec.assertoutcome(failed=1, passed=0) + + def test_ignored_whitespace_glob(self, testdir): + testdir.makeini(""" + [pytest] + doctest_optionflags = ELLIPSIS NORMALIZE_WHITESPACE + """) + p = testdir.maketxtfile(xdoc=""" + >>> a = "foo " + >>> print(a) + foo + """) + reprec = testdir.inline_run(p, "--doctest-glob=x*.txt") + reprec.assertoutcome(passed=1) + + def test_non_ignored_whitespace_glob(self, testdir): + testdir.makeini(""" + [pytest] + doctest_optionflags = ELLIPSIS + """) + p = testdir.maketxtfile(xdoc=""" + >>> a = "foo " + >>> print(a) + foo + """) + reprec = testdir.inline_run(p, "--doctest-glob=x*.txt") + reprec.assertoutcome(failed=1, passed=0)