def func_wrapper(self, *args, **kwargs): if escargs.args.expected_terminal == terminal: if not shouldTry: raise esctypes.KnownBug(reason + " (not trying)") try: func(self, *args, **kwargs) except Exception, e: tb = traceback.format_exc() lines = tb.split("\n") lines = map(lambda x: "KNOWN BUG: " + x, lines) raise esctypes.KnownBug(reason + "\n" + "\n".join(lines)) # Shouldn't get here because the test should have failed. If 'force' is on then # tests always pass, though. if not escargs.args.force and not noop: raise esctypes.InternalError("Should have failed") elif noop: raise esctypes.KnownBug( reason + " (test ran and passed, but is documented as a 'no-op'; the nature of the bug makes it untestable)" )
def func_wrapper(self, *args, **kwargs): hasOption = (escargs.args.options is not None and option in escargs.args.options) if escargs.args.expected_terminal == terminal: try: func(self, *args, **kwargs) except Exception, e: if hasOption: # Failed despite option being set. Re-raise. raise tb = traceback.format_exc() lines = tb.split("\n") lines = map( lambda x: "EXPECTED FAILURE (MISSING OPTION): " + x, lines) raise esctypes.KnownBug(reason + "\n\n" + "\n".join(lines)) # Got here because test passed. If the option isn't set, that's # unexpected so we raise an error. if not escargs.args.force and not hasOption and not allowPassWithoutOption: raise esctypes.InternalError("Should have failed: " + reason)