MCPcopy Index your code
hub / github.com/python-websockets/websockets / test_server

Method test_server

tests/legacy/test_client_server.py:1391–1405  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1389 self.loop.run_until_complete(run_client())
1390
1391 def test_server(self):
1392 # @asyncio.coroutine is deprecated on Python ≥ 3.8
1393 with warnings.catch_warnings():
1394 warnings.simplefilter("ignore")
1395
1396 @asyncio.coroutine
1397 def run_server():
1398 # Yield from serve.
1399 server = yield from serve(default_handler, "localhost", 0)
1400 self.assertTrue(server.sockets)
1401 server.close()
1402 yield from server.wait_closed()
1403 self.assertFalse(server.sockets)
1404
1405 self.loop.run_until_complete(run_server())
1406
1407
1408class AsyncAwaitTests(ClientServerTestsMixin, AsyncioTestCase):

Callers

nothing calls this directly

Calls 1

run_serverFunction · 0.85

Tested by

no test coverage detected