def application(environ, start_response):
    """Respond to a WSGI-interfaced HTTP request via test module."""
    global loaded
    if not loaded:
        loaded = True
        modname = 'cherrypy.test.' + environ['testmod']
        mod = __import__(modname, globals(), locals(), [''])
        mod.setup_server()

        cherrypy.config.update(
            {
                'log.error_file': os.path.join(curdir, 'test.error.log'),
                'log.access_file': os.path.join(curdir, 'test.access.log'),
                'environment': 'test_suite',
                'engine.SIGHUP': None,
                'engine.SIGTERM': None,
            },
        )
    return cherrypy.tree(environ, start_response)
Respond to a WSGI-interfaced HTTP request via test module.
cherrypy/test/modwsgi.py