cpython: e71142abf8b6 (original) (raw)
Mercurial > cpython
changeset 87835:e71142abf8b6
Issue #19535: Fixed test_docxmlrpc, test_functools, test_inspect, and test_statistics when python is run with -OO. [#19535]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Sun, 08 Dec 2013 18:16:18 +0200 |
parents | 1d0b7e90da4d(current diff)910b1cb5176c(diff) |
children | 0f587fe304be |
files | Lib/test/test_functools.py Lib/test/test_inspect.py Lib/test/test_statistics.py Misc/NEWS |
diffstat | 5 files changed, 14 insertions(+), 4 deletions(-)[+] [-] Lib/test/test_docxmlrpc.py 6 Lib/test/test_functools.py 3 Lib/test/test_inspect.py 3 Lib/test/test_statistics.py 3 Misc/NEWS 3 |
line wrap: on
line diff
--- a/Lib/test/test_docxmlrpc.py +++ b/Lib/test/test_docxmlrpc.py @@ -202,10 +202,12 @@ class DocXMLRPCHTTPGETServer(unittest.Te """ Test that annotations works as expected """ self.client.request("GET", "/") response = self.client.getresponse()
docstring = (b'' if sys.flags.optimize >= 2 else[](#l1.7)
b'<dd><tt>Use function annotations.</tt></dd>')[](#l1.8) self.assertIn([](#l1.9) (b'<dl><dt><a name="-annotation"><strong>annotation</strong></a>'[](#l1.10)
b'(x: int)</dt><dd><tt>Use function annotations.</tt>'[](#l1.11)
b'</dd></dl>\n<dl><dt><a name="-method_annotation"><strong>'[](#l1.12)
b'(x: int)</dt>' + docstring + b'</dl>\n'[](#l1.13)
b'<dl><dt><a name="-method_annotation"><strong>'[](#l1.14) b'method_annotation</strong></a>(x: bytes)</dt></dl>'),[](#l1.15) response.read())[](#l1.16)
--- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -1126,7 +1126,8 @@ class TestSingleDispatch(unittest.TestCa "Simple test" return "Test" self.assertEqual(g.name, "g")
self.assertEqual(g.__doc__, "Simple test")[](#l2.7)
if sys.flags.optimize < 2:[](#l2.8)
self.assertEqual(g.__doc__, "Simple test")[](#l2.9)
@unittest.skipUnless(decimal, 'requires _decimal') @support.cpython_only
--- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -2529,7 +2529,8 @@ class TestMain(unittest.TestCase): # Just a quick sanity check on the output self.assertIn(module.name, output) self.assertIn(module.file, output)
self.assertIn(module.__cached__, output)[](#l3.7)
if not sys.flags.optimize:[](#l3.8)
self.assertIn(module.__cached__, output)[](#l3.9) self.assertEqual(err, b'')[](#l3.10)
--- a/Lib/test/test_statistics.py +++ b/Lib/test/test_statistics.py @@ -8,6 +8,7 @@ import decimal import doctest import math import random +import sys import types import unittest @@ -625,6 +626,8 @@ class GlobalsTest(unittest.TestCase): class DocTests(unittest.TestCase):
- @unittest.skipIf(sys.flags.optimize >= 2,
def test_doc_tests(self): failed, tried = doctest.testmod(statistics) self.assertGreater(tried, 0)"Docstrings are omitted with -OO and above")[](#l4.16)
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -112,6 +112,9 @@ Library Tests ----- +- Issue #19535: Fixed test_docxmlrpc, test_functools, test_inspect, and