I am trying to run doctest for a function that works with zeros. But the teaching is not like zeros ...
def do_something_with_hex(c): """ >>> do_something_with_hex('\x00') '\x00' """ return repr(c) import doctest doctest.testmod()
I see these errors
Failed example: do_something_with_hex(' ') Exception raised: Traceback (most recent call last): File "C:\Python27\lib\doctest.py", line 1254, in __run compileflags, 1) in test.globs TypeError: compile() expected string without null bytes **********************************************************************
What can I do to resolve zeros in test cases?
source share