diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-11-29 22:26:26 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-11-29 22:26:26 (GMT) |
commit | d46430bd8147da24d1e17b5f13064e70acb8ee01 (patch) | |
tree | ceaa4c8db9d5c4c11ea45da263dd42c3fdf3d0e1 /Lib/unittest | |
parent | a5076a2543e9d52128b875bc4b3b0521ed3a2b12 (diff) | |
download | cpython-d46430bd8147da24d1e17b5f13064e70acb8ee01.zip cpython-d46430bd8147da24d1e17b5f13064e70acb8ee01.tar.gz cpython-d46430bd8147da24d1e17b5f13064e70acb8ee01.tar.bz2 |
now that deepcopy can handle instance methods, this hack can be removed #7409
Thanks Robert Collins
Diffstat (limited to 'Lib/unittest')
-rw-r--r-- | Lib/unittest/case.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index 113422c..8da5743 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -117,17 +117,6 @@ class _AssertRaisesContext(object): 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. @@ -201,7 +190,7 @@ class TestCase(object): 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 @@ -424,7 +413,7 @@ class TestCase(object): 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 |