summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_doctest.py
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2009-06-12 15:33:19 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2009-06-12 15:33:19 (GMT)
commit58641defe45cd8b05c28dea31a8a189d7fb31ce0 (patch)
tree58a3e0f1f71cf7177e0f9e084df814f2d99ace1f /Lib/test/test_doctest.py
parent554290d9209f0a552093f03e3c8c8e512b2a0efa (diff)
downloadcpython-58641defe45cd8b05c28dea31a8a189d7fb31ce0.zip
cpython-58641defe45cd8b05c28dea31a8a189d7fb31ce0.tar.gz
cpython-58641defe45cd8b05c28dea31a8a189d7fb31ce0.tar.bz2
Issue #6195: fix doctest to no longer try to read 'source' data from
binary files.
Diffstat (limited to 'Lib/test/test_doctest.py')
-rw-r--r--Lib/test/test_doctest.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py
index 9a128fb..8dcc8a4 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -2288,6 +2288,17 @@ using the optional keyword argument `encoding`:
>>> doctest.master = None # Reset master.
"""
+def test_testmod(): r"""
+Tests for the testmod function. More might be useful, but for now we're just
+testing the case raised by Issue 6195, where trying to doctest a C module would
+fail with a UnicodeDecodeError because doctest tried to read the "source" lines
+out of the binary module.
+
+ >>> import unicodedata
+ >>> doctest.testmod(unicodedata)
+ TestResults(failed=0, attempted=0)
+"""
+
######################################################################
## Main
######################################################################