diff options
author | R. David Murray <rdmurray@bitdance.com> | 2010-02-24 01:46:21 +0000 |
---|---|---|
committer | R. David Murray <rdmurray@bitdance.com> | 2010-02-24 01:46:21 +0000 |
commit | 378c0cf5abb4c49c1a95597d3c5284dc93dd7822 (patch) | |
tree | 0a7c9a724887dff98a5abefd9b09da0de6889731 /Lib/test/test_collections.py | |
parent | 72aee3dcabf98a0b8a7a60cccab4fbd1ef63fbd2 (diff) | |
download | cpython-git-378c0cf5abb4c49c1a95597d3c5284dc93dd7822.tar.gz |
Merged revisions 78351 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78351 | r.david.murray | 2010-02-22 19:24:49 -0500 (Mon, 22 Feb 2010) | 5 lines
Issue 6292: for the moment at least, the test suite passes if run
with -OO. Tests requiring docstrings are skipped. Patch by
Brian Curtin, thanks to Matias Torchinsky for helping review and
improve the patch.
........
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r-- | Lib/test/test_collections.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index 2dc71575a1..467ddef708 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -10,6 +10,7 @@ from random import randrange, shuffle import operator import keyword import re +import sys from collections import Hashable, Iterable, Iterator from collections import Sized, Container, Callable from collections import Set, MutableSet @@ -24,7 +25,6 @@ class TestNamedTuple(unittest.TestCase): def test_factory(self): Point = namedtuple('Point', 'x y') self.assertEqual(Point.__name__, 'Point') - self.assertEqual(Point.__doc__, 'Point(x, y)') self.assertEqual(Point.__slots__, ()) self.assertEqual(Point.__module__, __name__) self.assertEqual(Point.__getitem__, tuple.__getitem__) @@ -51,6 +51,12 @@ class TestNamedTuple(unittest.TestCase): self.assertRaises(TypeError, Point._make, [11]) # catch too few args self.assertRaises(TypeError, Point._make, [11, 22, 33]) # catch too many args + @unittest.skipIf(sys.flags.optimize >= 2, + "Docstrings are omitted with -O2 and above") + def test_factory_doc_attr(self): + Point = namedtuple('Point', 'x y') + self.assertEqual(Point.__doc__, 'Point(x, y)') + def test_name_fixer(self): for spec, renamed in [ [('efg', 'g%hi'), ('efg', '_1')], # field with non-alpha char |