[New-bugs-announce] [issue6363] __future__ statements break doctest

Poor Yorick report at bugs.python.org
Mon Jun 29 04:27:30 CEST 2009


New submission from Poor Yorick <pooryorick at users.sourceforge.net>:

(this error also occurs with "print_function")

Python 3.1 (r31:73574, Jun 26 2009, 20:21:35) [MSC v.1500 32 bit
(Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import unicode_literals
>>> import doctest
>>> def func1():
...    '''
...    >>> func1()
...    hello
...    '''
...    print('hello')
...
>>> doctest.testmod()
**********************************************************************
File "__main__", line 3, in __main__.func1
Failed example:
    func1()
Exception raised:
    Traceback (most recent call last):
      File "c:\Python31\lib\doctest.py", line 1242, in __run
        compileflags, 1), test.globs)
    ValueError: compile(): unrecognised flags
**********************************************************************
1 items had failures:
   1 of   1 in __main__.func1
***Test Failed*** 1 failures.
TestResults(failed=1, attempted=1)

----------
components: Library (Lib)
messages: 89807
nosy: pooryorick
severity: normal
status: open
title: __future__ statements break doctest
versions: Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6363>
_______________________________________


More information about the New-bugs-announce mailing list