mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #6195: fix doctest to no longer try to read 'source' data from
binary files.
This commit is contained in:
parent
554290d920
commit
58641defe4
3 changed files with 34 additions and 12 deletions
|
@ -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
|
||||
######################################################################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue