def config_subs(self, txt, subs=None): """ replace the strings in the config that we have reasonable values for """ substitutes = subs or { "testcase" : gp.find_testname(), "rootlogger" : "", "suitename" : environ.get("SUITE", "suite"), "datetime" : datetime.datetime.now().strftime("%y%m%d-%H%M%S"), } self.log("replaced subs:{}".format(substitutes)) return txt % substitutes
def __exit__(self, exception_type, exception_val, tb): self.log("__exit__ ") if exception_type and exception_type not in self.ignore_exceptions: buff = io.StringIO() traceback.print_tb(tb, file=buff) self.testlog("\n\n{}:{}:{}:\n{}".format( gp.find_testname(), exception_type.__name__, exception_val, buff.getvalue(), )) self.tear_down()