From 378c0cf5abb4c49c1a95597d3c5284dc93dd7822 Mon Sep 17 00:00:00 2001 From: "R. David Murray" Date: Wed, 24 Feb 2010 01:46:21 +0000 Subject: 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. ........ --- Lib/test/test_unittest.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Lib/test/test_unittest.py') diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py index 8627312824..75b9d0c797 100644 --- a/Lib/test/test_unittest.py +++ b/Lib/test/test_unittest.py @@ -2051,6 +2051,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) @@ -2060,6 +2062,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. @@ -2489,12 +2493,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. -- cgit v1.2.1