]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #19535: Fixed test_docxmlrpc when python is run with -OO.
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 8 Dec 2013 16:14:49 +0000 (18:14 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 8 Dec 2013 16:14:49 +0000 (18:14 +0200)
Lib/test/test_docxmlrpc.py
Misc/NEWS

index 7086d9a6a1223b2ca1622a69f6c8cd3c415e9472..cb6366c7d5c2a0e519fa05fe5dd6e59a54c6432f 100644 (file)
@@ -202,10 +202,12 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase):
         """ Test that annotations works as expected """
         self.client.request("GET", "/")
         response = self.client.getresponse()
+        docstring = (b'' if sys.flags.optimize >= 2 else
+                     b'<dd><tt>Use&nbsp;function&nbsp;annotations.</tt></dd>')
         self.assertIn(
             (b'<dl><dt><a name="-annotation"><strong>annotation</strong></a>'
-             b'(x: int)</dt><dd><tt>Use&nbsp;function&nbsp;annotations.</tt>'
-             b'</dd></dl>\n<dl><dt><a name="-method_annotation"><strong>'
+             b'(x: int)</dt>' + docstring + b'</dl>\n'
+             b'<dl><dt><a name="-method_annotation"><strong>'
              b'method_annotation</strong></a>(x: bytes)</dt></dl>'),
             response.read())
 
index 5a760ba625c40f6120aac31035a0595941160bf8..0eac7fb2ad74e290080ab6223847673fd0224720 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -97,6 +97,8 @@ Library
 Tests
 -----
 
+- Issue #19535: Fixed test_docxmlrpc when python is run with -OO.
+
 - Issue #19926: Removed unneeded test_main from test_abstract_numbers.
   Patch by Vajrasky Kok.