def tearDown(self):
        """Runs after each test method to tear down test environment."""
        try:
            self.mox.UnsetStubs()
            self.stubs.UnsetAll()
            self.stubs.SmartUnsetAll()
            self.mox.VerifyAll()
            super(TestCase, self).tearDown()
        finally:
            # Clean out fake_rabbit's queue if we used it
            if FLAGS.fake_rabbit:
                fakerabbit.reset_all()

            if FLAGS.connection_type == 'fake':
                if hasattr(fake.FakeConnection, '_instance'):
                    del fake.FakeConnection._instance

            if FLAGS.image_service == 'nova.image.fake.FakeImageService':
                nova.image.fake.FakeImageService_reset()

            # Reset any overriden flags
            self.reset_flags()

            # Stop any timers
            for x in self.injected:
                try:
                    x.stop()
                except __HOLE__:
                    pass

            # Kill any services
            for x in self._services:
                try:
                    x.kill()
                except Exception:
                    pass
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/test.py/TestCase.tearDown