I'm a Python beginner, for school, and I am a little pernickety. My teacher wants me to write a function, returning a sentence with an accent, "print()" show me the good characters, with the accent, but the doctest doesn't.
Here is my code :
def test() :
"""
>>> test()
à - â - ä - é - è - ê - ë - ï - î - ô - ö - ù - û - ü - ÿ - ç
"""
print("à - â - ä - é - è - ê - ë - ï - î - ô - ö - ù - û - ü - ÿ - ç")
import doctest
doctest.testmod(optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS, verbose = True)
As I said, print does show me properly the characters.
And here is the doctest, the issue :
Trying:
test()
Expecting:
\xe0 - \xe2 - \xe4 - \xe9 - \xe8 - \xea - \xeb - \xef - \xee - \xf4 - \xf6 - \xf9 - \xfb - \xfc - \xff - \xe7
ok
The test is passed, without a fail, but I really want the Doctest to read those characters without showing the Unicode Hex Character.
How could I fix this?
PS: My teacher use the IDE Thonny, so I naturally followed him, and I know he won't blame me (us, because my mates didn't search further and just change the 'é' to an 'e').