Commit 3e60a9d6 authored by Serhiy Storchaka's avatar Serhiy Storchaka

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

parent a82f74de
...@@ -202,10 +202,12 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase): ...@@ -202,10 +202,12 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase):
""" Test that annotations works as expected """ """ Test that annotations works as expected """
self.client.request("GET", "/") self.client.request("GET", "/")
response = self.client.getresponse() response = self.client.getresponse()
docstring = (b'' if sys.flags.optimize >= 2 else
b'<dd><tt>Use&nbsp;function&nbsp;annotations.</tt></dd>')
self.assertIn( self.assertIn(
(b'<dl><dt><a name="-annotation"><strong>annotation</strong></a>' (b'<dl><dt><a name="-annotation"><strong>annotation</strong></a>'
b'(x: int)</dt><dd><tt>Use&nbsp;function&nbsp;annotations.</tt>' b'(x: int)</dt>' + docstring + b'</dl>\n'
b'</dd></dl>\n<dl><dt><a name="-method_annotation"><strong>' b'<dl><dt><a name="-method_annotation"><strong>'
b'method_annotation</strong></a>(x: bytes)</dt></dl>'), b'method_annotation</strong></a>(x: bytes)</dt></dl>'),
response.read()) response.read())
......
...@@ -97,6 +97,8 @@ Library ...@@ -97,6 +97,8 @@ Library
Tests Tests
----- -----
- Issue #19535: Fixed test_docxmlrpc when python is run with -OO.
- Issue #19926: Removed unneeded test_main from test_abstract_numbers. - Issue #19926: Removed unneeded test_main from test_abstract_numbers.
Patch by Vajrasky Kok. Patch by Vajrasky Kok.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment