summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_docxmlrpc.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-12-08 16:14:49 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-12-08 16:14:49 (GMT)
commit3e60a9d602c85b738dc74a3c8a196650822e8619 (patch)
tree0c21357fd386696b3dbe8ef4ea1dde284c5ccd14 /Lib/test/test_docxmlrpc.py
parenta82f74dee35cb2d433fdf86e48ea6f5cd45b6ded (diff)
downloadcpython-3e60a9d602c85b738dc74a3c8a196650822e8619.zip
cpython-3e60a9d602c85b738dc74a3c8a196650822e8619.tar.gz
cpython-3e60a9d602c85b738dc74a3c8a196650822e8619.tar.bz2
Issue #19535: Fixed test_docxmlrpc when python is run with -OO.
Diffstat (limited to 'Lib/test/test_docxmlrpc.py')
-rw-r--r--Lib/test/test_docxmlrpc.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py
index 7086d9a..cb6366c 100644
--- a/Lib/test/test_docxmlrpc.py
+++ b/Lib/test/test_docxmlrpc.py
@@ -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())