मैं नल के साथ काम करने वाले फ़ंक्शन पर सबसे अच्छा चलाने की कोशिश कर रहा हूं। लेकिन doctest nulls की तरह प्रतीत नहीं होता है ...डॉकुटल्स में नल के साथ कैसे काम करें
def do_something_with_hex(c):
"""
>>> do_something_with_hex('\x00')
'\x00'
"""
return repr(c)
import doctest
doctest.testmod()
मैं इन त्रुटियों
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
**********************************************************************
क्या मैं इस तरह परीक्षण मामलों में nulls अनुमति देने के लिए क्या कर सकते हैं दिखाई दे रही है?
धन्यवाद। एक इलाज करता है! –