Package lxml :: Package tests :: Module dummy_http_server

[hide private]
[frames] | no frames]

# Module dummy_http_server

source code

Simple HTTP request dumper for tests.

Classes | [hide private]

| WebServer A web server that starts a new thread for each request.
| _RequestHandler
| HTTPRequestCollector

Functions | [hide private]

webserver(*args, **kwds) Context manager entry point for the 'with' statement. | source code

build_web_server(app, port, host=None) | source code

Variables | [hide private]

| __package__ = ``'``lxml.tests``'``

Function Details | [hide private]

### webserver(*args, **kwds)

source code

Context manager entry point for the 'with' statement.

Pass 0 as port number to dynamically allocate a free port.

Usage:

with webserver(wsgi_app_function, 8080) as host_url:
  do_ws_calls(host_url)

Decorators:
  - `@contextmanager`