diff -r 8e7a738c3840 Lib/test/test_docxmlrpc.py --- a/Lib/test/test_docxmlrpc.py Sat Nov 16 10:47:17 2013 -0500 +++ b/Lib/test/test_docxmlrpc.py Sat Nov 16 19:46:03 2013 +0200 @@ -202,10 +202,12 @@ """ Test that annotations works as expected """ self.client.request("GET", "/") response = self.client.getresponse() + docstring = (b'' if sys.flags.optimize >= 2 else + b'
Use function annotations.
') self.assertIn( (b'
annotation' - b'(x: int)
Use function annotations.' - b'
\n
' + b'(x: int)
' + docstring + b'
\n' + b'
' b'method_annotation(x: bytes)
'), response.read()) diff -r 8e7a738c3840 Lib/test/test_functools.py --- a/Lib/test/test_functools.py Sat Nov 16 10:47:17 2013 -0500 +++ b/Lib/test/test_functools.py Sat Nov 16 19:46:03 2013 +0200 @@ -1124,7 +1124,8 @@ "Simple test" return "Test" self.assertEqual(g.__name__, "g") - self.assertEqual(g.__doc__, "Simple test") + if sys.flags.optimize < 2: + self.assertEqual(g.__doc__, "Simple test") @unittest.skipUnless(decimal, 'requires _decimal') @support.cpython_only diff -r 8e7a738c3840 Lib/test/test_inspect.py --- a/Lib/test/test_inspect.py Sat Nov 16 10:47:17 2013 -0500 +++ b/Lib/test/test_inspect.py Sat Nov 16 19:46:03 2013 +0200 @@ -2525,7 +2525,8 @@ # Just a quick sanity check on the output self.assertIn(module.__name__, output) self.assertIn(module.__file__, output) - self.assertIn(module.__cached__, output) + if not sys.flags.optimize: + self.assertIn(module.__cached__, output) self.assertEqual(err, b'')