unicode in doctests

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bjorn Tillenius

    #1

    unicode in doctests

    I'm trying to combine documentation and testing, by using DocFileSuite
    from Python 2.4. But the problem is that I need to write non-ascii
    characters in the test, and I can't get it to work. I haven't found a
    way to specify which encoding the file is in, so it gets decoded to
    unicode.

    Anyone know if it's possible at all to use non-ascii character in a
    DocFileSuite?

    For example, this fails:
    [color=blue][color=green][color=darkred]
    >>> foo = u'föö'[/color][/color][/color]
    u'föö'

    BTW, I know that I can use \-notation, but since the test will serve as
    documentation as well, I don't want to use it.

    Regards,

    Bjorn
Working...