# Path: doubles/lifecycle.py
# def teardown():
#     """Tears down the current Doubles environment. Must be called after each test case."""
#     if hasattr(_thread_local_data, 'current_space'):
#         _thread_local_data.current_space.teardown()
#         del _thread_local_data.current_space
# 
# def verify():
#     """Verify a mock
# 
#     Verifies any mocks that have been created during the test run. Must be called after each
#     test case, but before teardown.
#     """
# 
#     if hasattr(_thread_local_data, 'current_space'):
#         _thread_local_data.current_space.verify()


import unittest
from doubles.lifecycle import teardown, verify
from __future__ import absolute_import




def wrap_test(test_func):
    def wrapper():
        test_func()
        verify()

    return wrapper


class TestCase(unittest.TestCase):
    def __init__(self, methodName='runTest'):
        super(TestCase, self).__init__(methodName)

        setattr(self, self._testMethodName, wrap_test(getattr(self, self._testMethodName)))

    def setUp(self):

# Path: doubles/lifecycle.py
# def teardown():
#     """Tears down the current Doubles environment. Must be called after each test case."""
#     if hasattr(_thread_local_data, 'current_space'):
#         _thread_local_data.current_space.teardown()
#         del _thread_local_data.current_space
# 
# def verify():
#     """Verify a mock
# 
#     Verifies any mocks that have been created during the test run. Must be called after each
#     test case, but before teardown.
#     """
# 
#     if hasattr(_thread_local_data, 'current_space'):
#         _thread_local_data.current_space.verify()


# Path: doubles/unittest.py
import unittest
from doubles.lifecycle import teardown, verify

from __future__ import absolute_import




def wrap_test(test_func):
    def wrapper():
        test_func()
        verify()

    return wrapper


class TestCase(unittest.TestCase):
    def __init__(self, methodName='runTest'):
        super(TestCase, self).__init__(methodName)

        setattr(self, self._testMethodName, wrap_test(getattr(self, self._testMethodName)))

    def setUp(self):

        self.addCleanup(teardown)