Issue #19535: Fixed test_docxmlrpc when python is run with -OO.

This commit is contained in:
Serhiy Storchaka 2013-12-08 18:14:49 +02:00
parent a82f74dee3
commit 3e60a9d602
2 changed files with 6 additions and 2 deletions

View 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())

View File

@ -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.