Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions Lib/test/test_doctest/sample_doctest_errors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"""This is a sample module used for testing doctest.

This module includes various scenarios involving errors.

>>> 2 + 2
5
>>> 1/0
1
"""

def g():
[][0] # line 12

def errors():
"""
>>> 2 + 2
5
>>> 1/0
1
>>> def f():
... 2 + '2'
...
>>> f()
1
>>> g()
1
"""

def syntax_error():
"""
>>> 2+*3
5
"""

__test__ = {
'bad': """
>>> 2 + 2
5
>>> 1/0
1
""",
}

def test_suite():
import doctest
return doctest.DocTestSuite()
Loading
Loading