diff options
| author | R. David Murray <rdmurray@bitdance.com> | 2010-02-23 00:24:49 (GMT) |
|---|---|---|
| committer | R. David Murray <rdmurray@bitdance.com> | 2010-02-23 00:24:49 (GMT) |
| commit | f28fd24c36310541a1f3ec74e92e8d38629dd5d8 (patch) | |
| tree | ca85998492ba91f8874ba63fecd77397f65ad3d6 /Lib/test/test_docxmlrpc.py | |
| parent | 87bcb243acfd758b3e91e194bf8f1198ae68a792 (diff) | |
| download | cpython-f28fd24c36310541a1f3ec74e92e8d38629dd5d8.zip cpython-f28fd24c36310541a1f3ec74e92e8d38629dd5d8.tar.gz cpython-f28fd24c36310541a1f3ec74e92e8d38629dd5d8.tar.bz2 | |
Issue 6292: for the moment at least, the test suite passes if run
with -OO. Tests requiring docstrings are skipped. Patch by
Brian Curtin, thanks to Matias Torchinsky for helping review and
improve the patch.
Diffstat (limited to 'Lib/test/test_docxmlrpc.py')
| -rw-r--r-- | Lib/test/test_docxmlrpc.py | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py index dae4109..1af3433 100644 --- a/Lib/test/test_docxmlrpc.py +++ b/Lib/test/test_docxmlrpc.py @@ -1,5 +1,6 @@ from DocXMLRPCServer import DocXMLRPCServer import httplib +import sys from test import test_support import threading import time @@ -8,6 +9,20 @@ import unittest PORT = None +def make_request_and_skipIf(condition, reason): + # If we skip the test, we have to make a request because the + # the server created in setUp blocks expecting one to come in. + if not condition: + return lambda func: func + def decorator(func): + def make_request_and_skip(self): + self.client.request("GET", "/") + self.client.getresponse() + raise unittest.SkipTest(reason) + return make_request_and_skip + return decorator + + def server(evt, numrequests): serv = DocXMLRPCServer(("localhost", 0), logRequests=False) @@ -111,10 +126,12 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase): '<lambda></strong></a>(x, y)</dt></dl>', response.read()) + @make_request_and_skipIf(sys.flags.optimize >= 2, + "Docstrings are omitted with -O2 and above") def test_autolinking(self): - """Test that the server correctly automatically wraps references to PEPS - and RFCs with links, and that it linkifies text starting with http or - ftp protocol prefixes. + """Test that the server correctly automatically wraps references to + PEPS and RFCs with links, and that it linkifies text starting with + http or ftp protocol prefixes. The documentation for the "add" method contains the test material. """ @@ -133,11 +150,13 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase): 'auto-linked, too:<br>\n<a href="http://google.com">' 'http://google.com</a>.</tt></dd></dl>'), response.read()) + @make_request_and_skipIf(sys.flags.optimize >= 2, + "Docstrings are omitted with -O2 and above") def test_system_methods(self): """Test the precense of three consecutive system.* methods. - This also tests their use of parameter type recognition and the systems - related to that process. + This also tests their use of parameter type recognition and the + systems related to that process. """ self.client.request("GET", "/") response = self.client.getresponse() |
