def __call__(self, *args, **kwargs):
        """Invoke the test.

        The test is "kicked-off" by calling this. Any arguments are passed to
        the test implementation (`execute` method).
        """
        self.config.register_testcase(self.test_name)
        self._report.add_heading(self.test_name, 2)
        if args or kwargs:
            self._report.add_message("TESTARGUMENTS", repr_args(args, kwargs), 2)
        self.starttime = timelib.now() # saved starttime in case initializer
                                                                     # needs to create the log file.
        self._initialize()
        # test elapsed time does not include initializer time.
        teststarttime = timelib.now()
        # run the execute() method and check for exceptions.
        try:
            rv = self.execute(*args, **kwargs)
        except KeyboardInterrupt:
            if self._debug:
                ex, val, tb = sys.exc_info()
                debugger.post_mortem(tb, ex, val)
            rv = self.incomplete("%s: aborted by user." % self.test_name)
            self._finalize(rv)
            raise
        except TestFailError, errval:
            rv = self.failed("Caught Fail exception: %s" % (errval,))
        except TestIncompleteError, errval:
            rv = self.incomplete("Caught incomplete exception: %s" % (errval,))
        # Test asserts and validation errors are based on this.
        except AssertionError as errval:
            rv = self.failed("failed assertion: %s" % (errval,))
        except TestSuiteAbort:
            self.config.register_testcase(None)
            raise # pass this one up to suite
        except debugger.DebuggerQuit: # set_trace "leaks" BdbQuit
            rv = self.incomplete("%s: Debugger exit." % (self.test_name, ))
        except ConfigError as cerr:
            rv = self.incomplete("Configuration error: {}".format(cerr))
            self.config.register_testcase(None)
            if self._debug:
                ex, val, tb = sys.exc_info()
                debugger.post_mortem(tb, ex, val)
                tb = None
            raise TestSuiteAbort(cerr)
        except:
            ex, val, tb = sys.exc_info()
            if self._debug:
                debugger.post_mortem(tb, ex, val)
                tb = None
            rv = self.incomplete("%s: Exception: (%s: %s)" % (self.test_name, ex, val))
        endtime = timelib.now()
        self.config.register_testcase(None)
        self._report.add_message("STARTTIME", teststarttime, 2)
        self._report.add_message("ENDTIME", endtime, 2)
        minutes, seconds = divmod(endtime - teststarttime, 60.0)
        hours, minutes = divmod(minutes, 60.0)
        self.info("Time elapsed: %02.0f:%02.0f:%02.2f" % (hours, minutes, seconds))
        return self._finalize(rv)
dataset/ETHPy150Open kdart/pycopia/QA/pycopia/QA/core.py/Test.__call__/original