Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e60a9d

Browse files
Issue #19535: Fixed test_docxmlrpc when python is run with -OO.
1 parent a82f74d commit 3e60a9d

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Lib/test/test_docxmlrpc.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,12 @@ def test_annotations(self):
202202
""" Test that annotations works as expected """
203203
self.client.request("GET", "/")
204204
response = self.client.getresponse()
205+
docstring = (b'' if sys.flags.optimize >= 2 else
206+
b'<dd><tt>Use&nbsp;function&nbsp;annotations.</tt></dd>')
205207
self.assertIn(
206208
(b'<dl><dt><a name="-annotation"><strong>annotation</strong></a>'
207-
b'(x: int)</dt><dd><tt>Use&nbsp;function&nbsp;annotations.</tt>'
208-
b'</dd></dl>\n<dl><dt><a name="-method_annotation"><strong>'
209+
b'(x: int)</dt>' + docstring + b'</dl>\n'
210+
b'<dl><dt><a name="-method_annotation"><strong>'
209211
b'method_annotation</strong></a>(x: bytes)</dt></dl>'),
210212
response.read())
211213

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ Library
9797
Tests
9898
-----
9999

100+
- Issue #19535: Fixed test_docxmlrpc when python is run with -OO.
101+
100102
- Issue #19926: Removed unneeded test_main from test_abstract_numbers.
101103
Patch by Vajrasky Kok.
102104

0 commit comments

Comments
 (0)