1. Armin Rigo
  2. cpython-withatomic

Commits

Benjamin Peterson  committed 218a7eb

now that deepcopy can handle instance methods, this hack can be removed #7409

Thanks Robert Collins

  • Participants
  • Parent commits a949255
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Lib/unittest/case.py

View file
         return True
 
 
-class _AssertWrapper(object):
-    """Wrap entries in the _type_equality_funcs registry to make them deep
-    copyable."""
-
-    def __init__(self, function):
-        self.function = function
-
-    def __deepcopy__(self, memo):
-        memo[id(self)] = self
-
-
 class TestCase(object):
     """A class whose instances are single test cases.
 
                     msg= argument that raises self.failureException with a
                     useful error message when the two arguments are not equal.
         """
-        self._type_equality_funcs[typeobj] = _AssertWrapper(function)
+        self._type_equality_funcs[typeobj] = function
 
     def addCleanup(self, function, *args, **kwargs):
         """Add a function, with arguments, to be called when the test is
         if type(first) is type(second):
             asserter = self._type_equality_funcs.get(type(first))
             if asserter is not None:
-                return asserter.function
+                return asserter
 
         return self._baseAssertEqual