def _finalize(self):
        try:
            self.finalize()
        except KeyboardInterrupt:
            if self._nested:
                raise TestSuiteAbort(
                        "Suite {!r} aborted by user in finalize().".format(self.test_name))
            else:
                self.info("Suite aborted by user in finalize().")
        except:
            ex, val, tb = sys.exc_info()
            if self._debug:
                print# ensure debugger prompts starts on new line.
                debugger.post_mortem(tb, ex, val)
            self.info("Suite failed to finalize: %s (%s)" % (ex, val))
            if self._nested:
                raise TestSuiteAbort(
                        "subordinate suite {!r} failed to finalize.".format(self.test_name))
        self._summarize()
        self._report_summary()
        return self.result
dataset/ETHPy150Open kdart/pycopia/QA/pycopia/QA/core.py/TestSuite._finalize/original