Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Kludex/uvicorn
/ functions
Functions
959 in github.com/Kludex/uvicorn
⨍
Functions
959
◇
Types & classes
102
↳
Endpoints
2
Function
test_reset_contextvars_asyncio
With reset_contextvars=True, each ASGI run starts with a fresh context. Non-regression test for https://github.com/encode/uvicorn/issues/2167.
tests/test_server.py:229
Function
test_reset_contextvars_runs_each_stream_in_a_fresh_context
()
tests/protocols/test_http2.py:1002
Function
test_response_body_before_start_returns_500
()
tests/protocols/test_http2.py:951
Function
test_response_header_splitting
(http_protocol_cls: type[HTTPProtocol])
tests/protocols/test_http.py:702
Function
test_response_longer_than_content_length_resets_stream
()
tests/protocols/test_http2.py:658
Function
test_response_shorter_than_content_length_resets_stream
()
tests/protocols/test_http2.py:641
Function
test_response_trailers
(te: bytes | None, caplog: pytest.LogCaptureFixture)
tests/protocols/test_http2.py:256
Function
test_resume_reading_waits_for_other_buffered_streams
Ending or consuming one stream must not release transport backpressure while another stream's body buffer is still over the high-water mark.
tests/protocols/test_http2.py:833
Function
test_return_close_header
(http_protocol_cls: type[HTTPProtocol])
tests/protocols/test_http.py:1167
Function
test_root_path
(http_protocol_cls: type[HTTPProtocol])
tests/protocols/test_http.py:830
Function
test_rst_stream_disconnects_the_app
()
tests/protocols/test_http2.py:675
Function
test_run
( tls_ca_ssl_context, tls_certificate_server_cert_path, tls_certificate_private_key_path, tls_
tests/test_ssl.py:23
Function
test_run
(host, url: str, unused_tcp_port: int)
tests/test_main.py:56
Function
test_run_chain
( tls_ca_ssl_context, tls_certificate_key_and_chain_path, tls_ca_certificate_pem_path, unused_
tests/test_ssl.py:46
Function
test_run_chain_only
(tls_ca_ssl_context, tls_certificate_key_and_chain_path, unused_tcp_port: int)
tests/test_ssl.py:67
Function
test_run_exits_with_startup_failure_on_unloadable_app
A server exits with the dedicated startup-failure code when the app can't load. The multiprocess supervisor relies on `STARTUP_FAILURE` to tell a
tests/test_server.py:125
Function
test_run_fails_fast_in_parent_on_bad_app_path
A bad app path exits in the parent for the single-process case. Regression for https://github.com/encode/uvicorn/issues/941: the app is impor
tests/test_main.py:91
Function
test_run_imports_app_before_starting_event_loop
`uvicorn.run()` imports the app before `Server.run` opens the event loop. Regression for https://github.com/encode/uvicorn/issues/941: an app who
tests/test_main.py:129
Function
test_run_invalid_app_config_combination
(caplog: pytest.LogCaptureFixture)
tests/test_main.py:80
Function
test_run_match_config_params
()
tests/test_main.py:175
Function
test_run_multiprocess
(unused_tcp_port: int)
tests/test_main.py:64
Function
test_run_password
( tls_ca_ssl_context, tls_certificate_server_cert_path, tls_ca_certificate_pem_path, tls_certi
tests/test_ssl.py:82
Function
test_run_reload
(unused_tcp_port: int)
tests/test_main.py:72
Function
test_run_skips_eager_app_import_with_workers
With `--workers > 1` the parent does not import the app. Spawn-based workers re-import everything, so loading it in the supervisor only waste
tests/test_main.py:111
Function
test_run_ssl_context_factory_custom
A factory that builds its own SSLContext from scratch should work without ssl_keyfile/ssl_certfile.
tests/test_ssl.py:133
Function
test_run_ssl_context_factory_default
A factory that just delegates to the default factory should produce a working server.
tests/test_ssl.py:106
Function
test_run_startup_failure
(caplog: pytest.LogCaptureFixture)
tests/test_main.py:163
Function
test_running_log_using_fd
(caplog: pytest.LogCaptureFixture, unused_tcp_port: int)
tests/middleware/test_logging.py:173
Function
test_running_log_using_uds
( caplog: pytest.LogCaptureFixture, short_socket_name: str, unused_tcp_port: int )
tests/middleware/test_logging.py:160
Function
test_scopes
( asgi2or3_app: ASGIApplication, expected_scopes: dict[str, str], http_protocol_cls: type[HTTPProt
tests/protocols/test_http.py:1022
Function
test_send_after_peer_close_raises_client_disconnected
Test that protocol-specific close errors are converted to OSError.
tests/protocols/test_websocket.py:1842
Function
test_send_after_protocol_close
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:400
Function
test_send_after_rst_stream_is_dropped
()
tests/protocols/test_http2.py:932
Function
test_send_and_close_connection
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:336
Function
test_send_before_handshake
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:431
Function
test_send_binary_data_to_client
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:318
Function
test_send_binary_data_to_server
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:377
Function
test_send_binary_data_to_server_bigger_than_default_on_websockets
( http_protocol_cls: HTTPProtocol, client_size_sent: int, server_size_max: int, expected_resul
tests/protocols/test_websocket.py:742
Function
test_send_close_on_server_shutdown
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:658
Function
test_send_respects_write_backpressure
Test that `send()` blocks while the transport's write buffer is full. Without backpressure, a server-initiated close can outrun in-flight data.
tests/protocols/test_websocket.py:1660
Function
test_send_text_data_to_client
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:300
Function
test_send_text_data_to_server
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:354
Function
test_server_can_read_messages_in_buffer_after_close
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:1215
Function
test_server_installs_auto_zttp_protocol
(unused_tcp_port: int)
tests/protocols/test_http2.py:1146
Function
test_server_interrupt
Test interrupting a Server that is run explicitly inside asyncio
tests/test_server.py:69
Function
test_server_keepalive_disabled
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:1902
Function
test_server_keepalive_ping_pong
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:1432
Function
test_server_keepalive_ping_timeout
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:1471
Function
test_server_multiple_websocket_http_response_start_events
The server should raise an exception if it sends multiple websocket.http.response.start events.
tests/protocols/test_websocket.py:1168
Function
test_server_reject_connection
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:848
Function
test_server_reject_connection_does_not_log_incomplete_handshake
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int, caplog:
tests/protocols/test_websocket.py:1009
Function
test_server_reject_connection_with_body_nolength
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:1068
Function
test_server_reject_connection_with_custom_content_headers
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:916
Function
test_server_reject_connection_with_invalid_msg
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:1100
Function
test_server_reject_connection_with_invalid_status
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:1035
Function
test_server_reject_connection_with_missing_body
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:1134
Function
test_server_reject_connection_with_multibody_response
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:969
Function
test_server_reject_connection_with_non_utf8_body
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:942
Function
test_server_reject_connection_with_response
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:885
Function
test_server_sends_http2_trailers_over_tcp
(unused_tcp_port: int)
tests/protocols/test_http2.py:1236
Function
test_server_start_with_port_zero
(caplog: pytest.LogCaptureFixture)
tests/middleware/test_logging.py:202
Function
test_set_app_via_environment_variable
()
tests/test_cli.py:226
Function
test_setup_event_loop_is_removed
(caplog: pytest.LogCaptureFixture)
tests/test_config.py:691
Method
test_should_not_reload_when_dot_file_is_changed
(self, touch_soon: Callable[..., Event])
tests/supervisors/test_reload.py:194
Method
test_should_not_reload_when_exclude_pattern_match_file_is_changed
( self, touch_soon: Callable[..., Event] )
tests/supervisors/test_reload.py:171
Method
test_should_not_reload_when_only_subdirectory_is_watched
( self, touch_soon: Callable[..., Event] )
tests/supervisors/test_reload.py:231
Method
test_should_not_reload_when_python_file_in_excluded_subdir_is_changed
(self, touch_soon: Callable[..., Event])
tests/supervisors/test_reload.py:138
Method
test_should_reload_when_directories_have_same_prefix
( self, touch_soon: Callable[..., Event] )
tests/supervisors/test_reload.py:206
Method
test_should_reload_when_python_file_in_subdir_is_changed
(self, touch_soon: Callable[..., Event])
tests/supervisors/test_reload.py:126
Function
test_should_warn_on_invalid_reload_configuration
(tmp_path: Path, caplog: pytest.LogCaptureFixture)
tests/test_config.py:62
Function
test_should_watch_cwd
(mocker: MockerFixture, reload_directory_structure: Path)
tests/supervisors/test_reload.py:323
Function
test_should_watch_multiple_dirs
(mocker: MockerFixture, reload_directory_structure: Path)
tests/supervisors/test_reload.py:333
Function
test_shutdown
(ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int)
tests/protocols/test_websocket.py:164
Function
test_shutdown_during_denial_response
(ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol)
tests/protocols/test_websocket.py:1821
Function
test_shutdown_during_idle
(http_protocol_cls: type[HTTPProtocol])
tests/protocols/test_http.py:894
Function
test_shutdown_during_request
(http_protocol_cls: type[HTTPProtocol])
tests/protocols/test_http.py:883
Function
test_shutdown_on_early_exit_during_startup
Test that lifespan.shutdown is called even when should_exit is set during startup.
tests/test_server.py:90
Function
test_shutdown_refuses_new_streams_and_closes_after_last_response
()
tests/protocols/test_http2.py:773
Function
test_shutdown_twice_is_a_no_op
()
tests/protocols/test_http2.py:763
Function
test_shutdown_waits_for_app_task_to_complete
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:1249
Function
test_shutdown_when_idle_closes_connection
()
tests/protocols/test_http2.py:748
Function
test_shutdown_while_the_close_reply_is_pending
Test that server shutdown does not send a second close frame during the handshake.
tests/protocols/test_websocket.py:1810
Function
test_sigint_abort_req
1. Request is sent 2. Sigint is sent to uvicorn 3. Shutdown sequence start 4. Request is _NOT_ finished before timeout_graceful_shutd
tests/supervisors/test_signal.py:49
Function
test_sigint_deny_request_after_triggered
1. Server is started 2. Shutdown sequence start 3. Request is sent, but not accepted Result: Request should fail, and not be able to
tests/supervisors/test_signal.py:91
Function
test_sigint_finish_req
1. Request is sent 2. Sigint is sent to uvicorn 3. Shutdown sequence start 4. Request is finished before timeout_graceful_shutdown=1
tests/supervisors/test_signal.py:14
Function
test_socket_bind
()
tests/test_config.py:274
Function
test_ssl_ciphers_applied_when_set
( tls_certificate_server_cert_path: str, tls_certificate_private_key_path: str, )
tests/test_ssl.py:202
Function
test_ssl_config
( tls_ca_certificate_pem_path: str, tls_ca_certificate_private_key_path: str, )
tests/test_config.py:283
Function
test_ssl_config_combined
(tls_certificate_key_and_chain_path: str)
tests/test_config.py:297
Function
test_ssl_context_factory_must_return_ssl_context
()
tests/test_ssl.py:193
Function
test_ssl_context_factory_mutates_default
The factory can call the default and mutate the result (e.g., bump TLS minimum version).
tests/test_ssl.py:159
Function
test_streaming_response
()
tests/protocols/test_http2.py:451
Function
test_subprocess_started
()
tests/test_subprocess.py:31
Function
test_subprotocols
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, subprotocol: str, unused_tcp_p
tests/protocols/test_websocket.py:697
Function
test_supported_upgrade_request
(http_protocol_cls: type[HTTPProtocol])
tests/protocols/test_http.py:957
Function
test_supports_permessage_deflate_extension
( ws_protocol_cls: WSProtocol, http_protocol_cls: HTTPProtocol, unused_tcp_port: int )
tests/protocols/test_websocket.py:176
Function
test_tls_without_alpn_selects_http1
()
tests/protocols/test_http2.py:1112
Function
test_trace_logging
(caplog: pytest.LogCaptureFixture, logging_config: dict[str, Any], unused_tcp_port: int)
tests/middleware/test_logging.py:48
Function
test_trace_logging
(caplog: pytest.LogCaptureFixture, logging_config: dict[str, Any])
tests/protocols/test_http2.py:1022
Function
test_trace_logging_on_http_protocol
(http_protocol_cls, caplog, logging_config, unused_tcp_port: int)
tests/middleware/test_logging.py:70
← previous
next →
801–900 of 959, ranked by callers