# -*- coding: iso-8859-15 -*- def test_latin9(): """Testing the iso-8859-15 encoding in doctests From unicode: >>> print u"C'est l'été !" C'est l'été ! From string: >>> print "Ce livre coûte 3¤50." Ce livre coûte 3¤50. """ return "C'est l'été !" == "C'est l'été !" def _test(): import doctest finder = doctest.DocTestFinder() tests = finder.find(test_latin9) runner = doctest.DocTestRunner() for t in tests: tried, failed = runner.run(t) runner.summarize(verbose=1) def _test2(): import doctest doctest.testmod() if __name__ == "__main__": # Python is able to print the docstring: print test_latin9.__doc__ # Python is able to compare two latin9 strings print test_latin9() # But doctest is unable to run the tests properly _test()