def _run(self, test, result): result._testRunEntered = True self._tearDownPreviousClass(test, result) self._handleModuleFixture(test, result) self._handleClassSetUp(test, result) result._previousTestClass = test.__class__ if (getattr(test.__class__, '_classSetupFailed', False) or getattr(result, '_moduleSetUpFailed', False)): return start = time.monotonic() test.run(result) elapsed = time.monotonic() - start result.record_test_stats(test, {'running-time': elapsed}) result._testRunEntered = False return result