def test_dochelper(self): EnvOption.set_prefix('MYPREFIX_') os.environ['MYPREFIX_A_OPT'] = 'FUZZ' returned = dochelper(__doc__) expected = __doc__.replace( "-a --a-opt OPT # An example long option", "-a --a-opt OPT # An example long option [default: FUZZ]") print(returned) print(expected) assert returned == expected
def setup(self): os.environ = {} EnvOption.set_prefix(None)