def test__server_multiple_processes() -> None:

    # Can't use an ioloop in this test
    with mock.patch('tornado.httpserver.HTTPServer.add_sockets'):
        with mock.patch('tornado.process.fork_processes') as tornado_fp:
            application = Application()
            server.Server(application, num_procs=3, port=0)

        tornado_fp.assert_called_with(3, mock.ANY)
예제 #2
0
def test__server_multiple_processes() -> None:

    # Can't use an ioloop in this test
    with mock.patch('tornado.httpserver.HTTPServer.add_sockets'):
        with mock.patch('tornado.process.fork_processes') as tornado_fp:
            application = Application()
            server.Server(application, num_procs=3, port=0)

        assert tornado_fp.mock_calls == [
            mock.call(3, None)
            if tornado.version_info >= (6,)
            else mock.call(3)
        ]