mirror of https://github.com/python/cpython
Speed up the test by avoiding socket timeouts.
This commit is contained in:
parent
1f2995b014
commit
162d719113
|
@ -462,12 +462,14 @@ class SimpleServerTestCase(unittest.TestCase):
|
|||
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
|
||||
|
||||
def test_dotted_attribute(self):
|
||||
# this will raise AttirebuteError because code don't want us to use
|
||||
# private methods
|
||||
# Raises an AttributeError because private methods are not allowed.
|
||||
self.assertRaises(AttributeError,
|
||||
SimpleXMLRPCServer.resolve_dotted_attribute, str, '__add')
|
||||
|
||||
self.assert_(SimpleXMLRPCServer.resolve_dotted_attribute(str, 'title'))
|
||||
# Get the test to run faster by sending a request with test_simple1.
|
||||
# This avoids waiting for the socket timeout.
|
||||
self.test_simple1()
|
||||
|
||||
# This is a contrived way to make a failure occur on the server side
|
||||
# in order to test the _send_traceback_header flag on the server
|
||||
|
@ -483,7 +485,7 @@ class FailingServerTestCase(unittest.TestCase):
|
|||
def setUp(self):
|
||||
self.evt = threading.Event()
|
||||
# start server thread to handle requests
|
||||
serv_args = (self.evt, 2)
|
||||
serv_args = (self.evt, 1)
|
||||
threading.Thread(target=http_server, args=serv_args).start()
|
||||
|
||||
# wait for the server to be ready
|
||||
|
|
Loading…
Reference in New Issue