def patch_testcase():
 def enter_atomics_wrapper(wrapped_func):
  '\n        Wrapper for TestCase._enter_atomics\n        '
  wrapped_func = wrapped_func.__func__
  def _wrapper(*args, **kwargs):
   '\n            Method that performs atomic-entering accounting.\n            '
   CommitOnSuccessManager.ENABLED = False
   OuterAtomic.ALLOW_NESTED = True
   if (not hasattr(OuterAtomic, 'atomic_for_testcase_calls')):
    OuterAtomic.atomic_for_testcase_calls = 0
   OuterAtomic.atomic_for_testcase_calls += 1
   return wrapped_func(*args, **kwargs)
  return classmethod(_wrapper)
 def rollback_atomics_wrapper(wrapped_func):
  '\n        Wrapper for TestCase._rollback_atomics\n        '
  wrapped_func = wrapped_func.__func__
  def _wrapper(*args, **kwargs):
   '\n            Method that performs atomic-rollback accounting.\n            '
   CommitOnSuccessManager.ENABLED = True
   OuterAtomic.ALLOW_NESTED = False
   OuterAtomic.atomic_for_testcase_calls -= 1
   return wrapped_func(*args, **kwargs)
  return classmethod(_wrapper)
 TestCase._enter_atomics = enter_atomics_wrapper(TestCase._enter_atomics)
 TestCase._rollback_atomics = rollback_atomics_wrapper(TestCase._rollback_atomics)

def patch_testcase ( ) : def enter_atomics_wrapper ( wrapped_func ) : wrapped_func = wrapped_func . __func__ def _wrapper ( * args , ** kwargs ) : CommitOnSuccessManager . ENABLED = False OuterAtomic . ALLOW_NESTED = True if ( not hasattr ( OuterAtomic , 'atomic_for_testcase_calls' ) ) : OuterAtomic . atomic_for_testcase_calls = 0 OuterAtomic . atomic_for_testcase_calls += 1 return wrapped_func ( * args , ** kwargs ) return classmethod ( _wrapper ) def rollback_atomics_wrapper ( wrapped_func ) : wrapped_func = wrapped_func . __func__ def _wrapper ( * args , ** kwargs ) : CommitOnSuccessManager . ENABLED = True OuterAtomic . ALLOW_NESTED = False OuterAtomic . atomic_for_testcase_calls -= 1 return wrapped_func ( * args , ** kwargs ) return classmethod ( _wrapper ) TestCase . _enter_atomics = enter_atomics_wrapper ( TestCase . _enter_atomics ) TestCase . _rollback_atomics = rollback_atomics_wrapper ( TestCase . _rollback_atomics )
disable commit_on_success decorators for tests in testcase subclasses .