summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unittest.py
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2010-02-23 00:24:49 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2010-02-23 00:24:49 (GMT)
commitf28fd24c36310541a1f3ec74e92e8d38629dd5d8 (patch)
treeca85998492ba91f8874ba63fecd77397f65ad3d6 /Lib/test/test_unittest.py
parent87bcb243acfd758b3e91e194bf8f1198ae68a792 (diff)
downloadcpython-f28fd24c36310541a1f3ec74e92e8d38629dd5d8.zip
cpython-f28fd24c36310541a1f3ec74e92e8d38629dd5d8.tar.gz
cpython-f28fd24c36310541a1f3ec74e92e8d38629dd5d8.tar.bz2
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_unittest.py')
-rw-r--r--Lib/test/test_unittest.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py
index d5f9a5c..d009bf9 100644
--- a/Lib/test/test_unittest.py
+++ b/Lib/test/test_unittest.py
@@ -2041,6 +2041,8 @@ class Test_TestResult(TestCase):
'testGetDescriptionWithoutDocstring (' + __name__ +
'.Test_TestResult)')
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def testGetDescriptionWithOneLineDocstring(self):
"""Tests getDescription() for a method with a docstring."""
result = unittest.TextTestResult(None, True, 1)
@@ -2050,6 +2052,8 @@ class Test_TestResult(TestCase):
'(' + __name__ + '.Test_TestResult)\n'
'Tests getDescription() for a method with a docstring.'))
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def testGetDescriptionWithMultiLineDocstring(self):
"""Tests getDescription() for a method with a longer docstring.
The second line of the docstring.
@@ -2525,12 +2529,16 @@ class Test_TestCase(TestCase, TestEquality, TestHashing):
def testShortDescriptionWithoutDocstring(self):
self.assertIsNone(self.shortDescription())
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def testShortDescriptionWithOneLineDocstring(self):
"""Tests shortDescription() for a method with a docstring."""
self.assertEqual(
self.shortDescription(),
'Tests shortDescription() for a method with a docstring.')
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def testShortDescriptionWithMultiLineDocstring(self):
"""Tests shortDescription() for a method with a longer docstring.