我们从Python开源项目中,提取了以下9个代码示例,用于说明如何使用doctest.register_optionflag()。
def _get_allow_unicode_flag(): """ Registers and returns the ALLOW_UNICODE flag. """ import doctest return doctest.register_optionflag('ALLOW_UNICODE')
def _get_allow_bytes_flag(): """ Registers and returns the ALLOW_BYTES flag. """ import doctest return doctest.register_optionflag('ALLOW_BYTES')