summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_parser.py8
-rw-r--r--Lib/unittest/case.py15
2 files changed, 6 insertions, 17 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index d8df6a8..10d6fe2 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -208,7 +208,7 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
def test_position(self):
# An absolutely minimal test of position information. Better
# tests would be a big project.
- code = "def f(x):\n return x + 1\n"
+ code = "def f(x):\n return x + 1"
st1 = parser.suite(code)
st2 = st1.totuple(line_info=1, col_info=1)
@@ -237,9 +237,9 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
(14, '+', 2, 13),
(2, '1', 2, 15),
(4, '', 2, 16),
- (6, '', 3, -1),
- (4, '', 3, -1),
- (0, '', 3, -1)],
+ (6, '', 2, -1),
+ (4, '', 2, -1),
+ (0, '', 2, -1)],
terminals)
def test_extended_unpacking(self):
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
index 4f9c496..daade71 100644
--- a/Lib/unittest/case.py
+++ b/Lib/unittest/case.py
@@ -130,17 +130,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.
@@ -214,7 +203,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
@@ -437,7 +426,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