diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-12-13 02:10:36 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-12-13 02:10:36 (GMT) |
commit | 8f326b23695dc4996327da8477e11aad42c61953 (patch) | |
tree | 4e958dc9812fe6417eb75ea30a1bd409e2341c73 /Lib | |
parent | 0496c9ee0a6937eaa94800a74749086add28e27f (diff) | |
download | cpython-8f326b23695dc4996327da8477e11aad42c61953.zip cpython-8f326b23695dc4996327da8477e11aad42c61953.tar.gz cpython-8f326b23695dc4996327da8477e11aad42c61953.tar.bz2 |
Merged revisions 76052,76522,76591,76689,76697,76733 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76052 | gregory.p.smith | 2009-11-01 20:02:38 -0600 (Sun, 01 Nov 2009) | 5 lines
see issue1006238, this merges in the following patch to ease cross
compiling the printf %zd check.
http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/files/python-2.5-cross-printf.patch?rev=1.1&view=markup
........
r76522 | barry.warsaw | 2009-11-25 12:38:32 -0600 (Wed, 25 Nov 2009) | 2 lines
Add mktime_tz to __all__. It's documented as being available in email.utils.
........
r76591 | benjamin.peterson | 2009-11-29 16:26:26 -0600 (Sun, 29 Nov 2009) | 4 lines
now that deepcopy can handle instance methods, this hack can be removed #7409
Thanks Robert Collins
........
r76689 | benjamin.peterson | 2009-12-06 11:37:48 -0600 (Sun, 06 Dec 2009) | 1 line
rewrite translate_newlines for clarity
........
r76697 | benjamin.peterson | 2009-12-06 15:24:30 -0600 (Sun, 06 Dec 2009) | 2 lines
fix test_parser from tokenizer tweak
........
r76733 | benjamin.peterson | 2009-12-09 21:37:59 -0600 (Wed, 09 Dec 2009) | 1 line
substitute PyDict_Check() for PyObject_IsInstance
........
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_parser.py | 8 | ||||
-rw-r--r-- | Lib/unittest/case.py | 15 |
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 |