Add a doctest for module docstrings
This commit is contained in:
parent
1de5af66da
commit
bf2f2dc2a6
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue