cheroot.test.conftest module#

Pytest configuration module.

Contains fixtures, which are tightly bound to the Cheroot framework itself, useless for end-users’ app testing.

cheroot.test.conftest.ca()#

Provide a certificate authority via fixture.

cheroot.test.conftest.http_request_timeout()#

Return a common HTTP request timeout for tests with queries.

cheroot.test.conftest.http_server()#

Provision a server creator as a fixture.

cheroot.test.conftest.make_http_server(bind_addr)#

Create and start an HTTP server bound to bind_addr.

cheroot.test.conftest.native_server_client(native_server)#

Create a test client out of given HTTP server.

cheroot.test.conftest.native_server_thread(thread_and_native_server)#

Set up and tear down a Cheroot HTTP server instance.

This exposes the server thread.

cheroot.test.conftest.tls_ca_certificate_pem_path(ca)#

Provide a certificate authority certificate file via fixture.

cheroot.test.conftest.tls_certificate(ca)#

Generate a TLS server certificate for testing.

Creates a certificate valid for ‘test-server.local’, ‘localhost’, and ‘127.0.0.1’ with CN=localhost.

cheroot.test.conftest.tls_certificate_chain_pem_path(tls_certificate)#

Provide a certificate chain PEM file path via fixture.

cheroot.test.conftest.tls_certificate_passwd_private_key_pem_path(tls_certificate, private_key_password, tmp_path)#

Return a certificate private key PEM file path.

cheroot.test.conftest.tls_certificate_pem_path(tls_certificate)#

Return path to temp file containing the server certificate in PEM format.

The file is automatically cleaned up after the test completes.

cheroot.test.conftest.tls_certificate_private_key_pem_path(tls_certificate)#

Provide a certificate private key PEM file path via fixture.

cheroot.test.conftest.wsgi_server_client(wsgi_server)#

Create a test client out of given WSGI server.

cheroot.test.conftest.wsgi_server_thread(thread_and_wsgi_server)#

Set up and tear down a Cheroot WSGI server instance.

This exposes the server thread.