fastapi/tests
easonysliu 2ea91122c9 Emit UserWarning when Response.background silently discards injected BackgroundTasks
When an endpoint injects BackgroundTasks via dependency injection AND
returns a Response that already has its own `background` attribute set,
the injected tasks are silently dropped. This is a confusing footgun
that causes tasks to disappear without any indication.

This change adds a UserWarning in that scenario so the silent data loss
becomes visible. The warning message explains how to resolve the
conflict (either use the injected BackgroundTasks exclusively, or stop
injecting BackgroundTasks when using Response.background directly).

Ref: https://github.com/fastapi/fastapi/issues/11215

Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
2026-03-14 14:08:25 +08:00
..
benchmarks Run performance tests only on Pydantic v2 (#14608) 2025-12-26 20:40:26 +00:00
test_modules_same_name_body Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_request_params 🐛 Fix JSON Schema for files, use `contentMediaType` instead of `format: binary` (#14953) 2026-02-21 14:01:31 +01:00
test_tutorial Add support for Server Sent Events (#15030) 2026-03-01 10:21:52 +01:00
test_validate_response_recursive Drop support for Pydantic v1, keeping short temporary support for Pydantic v2's `pydantic.v1` (#14575) 2025-12-20 16:55:38 +01:00
__init__.py Add first tests, for path and query 2018-12-08 11:56:07 +04:00
forward_reference_type.py Add support for wrapped functions (e.g. `@functools.wraps()`) used with forward references (#5077) 2025-12-02 18:23:14 +01:00
main.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_additional_properties.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_additional_properties_bool.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_additional_response_extra.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_additional_responses_bad.py Add support for OpenAPI 3.1.0 (#9770) 2023-06-30 20:25:16 +02:00
test_additional_responses_custom_model_in_callback.py 🐛 Update `ValidationError` schema to include `input` and `ctx` (#14791) 2026-02-04 15:34:02 +01:00
test_additional_responses_custom_validationerror.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_additional_responses_default_validationerror.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_additional_responses_response_class.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_additional_responses_router.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_additional_responses_union_duplicate_anyof.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_allow_inf_nan_in_enforcing.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_ambiguous_params.py Drop support for Pydantic v1, keeping short temporary support for Pydantic v2's `pydantic.v1` (#14575) 2025-12-20 16:55:38 +01:00
test_annotated.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_application.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_arbitrary_types.py Drop support for Pydantic v1, keeping short temporary support for Pydantic v2's `pydantic.v1` (#14575) 2025-12-20 16:55:38 +01:00
test_callable_endpoint.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_compat.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_computed_fields.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_custom_middleware_exception.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_custom_route_class.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_custom_schema_fields.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_custom_swagger_ui_redirect.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_datastructures.py Drop support for Pydantic v1, keeping short temporary support for Pydantic v2's `pydantic.v1` (#14575) 2025-12-20 16:55:38 +01:00
test_datetime_custom_encoder.py Drop support for `pydantic.v1` (#14609) 2025-12-27 13:54:56 +01:00
test_default_response_class.py Re-export utils from Starlette (#1064) 2020-03-01 21:49:20 +01:00
test_default_response_class_router.py Re-export utils from Starlette (#1064) 2020-03-01 21:49:20 +01:00
test_dependencies_utils.py Drop support for Python 3.9 (#14897) 2026-02-11 19:32:12 +01:00
test_dependency_after_yield_raise.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_dependency_after_yield_streaming.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_dependency_after_yield_websockets.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_dependency_cache.py 🐛 Fix cached dependencies when using a dependency in `Security()` and other places (e.g. `Depends()`) with different OAuth2 scopes (#2945) 2022-08-23 13:30:24 +00:00
test_dependency_class.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_dependency_contextmanager.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_dependency_contextvars.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_dependency_duplicates.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_dependency_overrides.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_dependency_paramless.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_dependency_partial.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_dependency_pep695.py Add support for PEP695 `TypeAliasType` (#13920) 2026-02-05 18:34:34 +00:00
test_dependency_security_overrides.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_dependency_wrapped.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_dependency_yield_except_httpexception.py 🐛 Fix support for `StreamingResponse`s with dependencies with `yield` or `UploadFile`s, close after the response is done (#14099) 2025-09-29 05:29:38 +02:00
test_dependency_yield_scope.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_dependency_yield_scope_websockets.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_depends_hashable.py ♻️ Make the result of `Depends()` and `Security()` hashable, as a workaround for other tools interacting with these internal parts (#14372) 2025-11-19 17:50:18 +01:00
test_deprecated_openapi_prefix.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_deprecated_responses.py 🗑️ Deprecate `ORJSONResponse` and `UJSONResponse` (#14964) 2026-02-22 17:34:59 +01:00
test_dump_json_fast_path.py Serialize JSON response with Pydantic (in Rust), when there's a Pydantic return type or response model (#14962) 2026-02-22 17:07:19 +01:00
test_duplicate_models_openapi.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_empty_router.py ⬆️ Upgrade and fully migrate to Ruff, remove isort, includes a couple of tweaks suggested by the new version of Ruff (#9660) 2023-06-12 00:37:34 +02:00
test_enforce_once_required_parameter.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_exception_handlers.py 🐛 Preserve traceback when exception is raised in sync dependency with `yield` (#5823) 2024-12-03 23:37:12 +01:00
test_extra_routes.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_fastapi_cli.py 🐛 Fix Windows UnicodeEncodeError in CLI test (#14295) 2025-12-02 04:02:38 +00:00
test_file_and_form_order_issue_9116.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_filter_pydantic_sub_model_pv2.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_form_default.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_forms_from_non_typing_sequences.py Add support for not needing `...` as default value in required Query(), Path(), Header(), etc. (#4906) 2022-05-13 18:38:22 -05:00
test_forms_single_model.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_forms_single_param.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_generate_unique_id_function.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_generic_parameterless_depends.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_get_model_definitions_formfeed_escape.py 🐛 Update `ValidationError` schema to include `input` and `ctx` (#14791) 2026-02-04 15:34:02 +01:00
test_get_request_body.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_http_connection_injection.py Add support for injecting HTTPConnection (#1827) 2020-08-09 15:56:41 +02:00
test_include_route.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_include_router_defaults_overrides.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_infer_param_optionality.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_inherited_custom_class.py Drop support for `pydantic.v1` (#14609) 2025-12-27 13:54:56 +01:00
test_invalid_path_param.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_invalid_sequence_param.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_json_type.py 🐛 Fix using `Json[list[str]]` type (issue #10997) (#14616) 2026-02-05 18:41:43 +00:00
test_jsonable_encoder.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_list_bytes_file_order_preserved_issue_14811.py Tweak comment in test to reference PR (#14885) 2026-02-10 12:14:38 +00:00
test_local_docs.py Improve type annotations, add support for mypy --strict, internally and for external packages (#2547) 2020-12-20 19:50:00 +01:00
test_multi_body_errors.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_multi_query_errors.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_multipart_installation.py ♻️ Update logic to import and check `python-multipart` for compatibility with newer version (#12627) 2024-10-27 21:46:26 +00:00
test_no_schema_split.py 🐛 Update `ValidationError` schema to include `input` and `ctx` (#14791) 2026-02-04 15:34:02 +01:00
test_no_swagger_ui_redirect.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_openapi_cache_root_path.py ♻️ Refactor logic to handle OpenAPI and Swagger UI escaping data (#14986) 2026-02-24 09:28:10 +00:00
test_openapi_examples.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_openapi_model_description_trim_on_formfeed.py 🐛 Fix truncating the model's description with form feed (`\f`) character for Pydantic V2 (#13698) 2025-06-17 09:46:27 +02:00
test_openapi_query_parameter_extension.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_openapi_route_extensions.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_openapi_schema_type.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_openapi_separate_input_output_schemas.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_openapi_servers.py 🔥 Remove Pydantic v1 specific test variants (#14611) 2025-12-27 19:19:10 +01:00
test_operations_signatures.py Add include, exclude, and by_alias to path operation methods (#264) 2019-05-27 16:08:13 +04:00
test_optional_file_list.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_orjson_response_class.py 🗑️ Deprecate `ORJSONResponse` and `UJSONResponse` (#14964) 2026-02-22 17:34:59 +01:00
test_param_class.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_param_in_path_and_dependency.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_param_include_in_schema.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_params_repr.py 🔥 Remove Pydantic v1 specific test variants (#14611) 2025-12-27 19:19:10 +01:00
test_path.py 🔥 Remove Pydantic v1 specific test variants (#14611) 2025-12-27 19:19:10 +01:00
test_put_no_body.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_pydantic_v1_error.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_pydanticv2_dataclasses_uuid_stringified_annotations.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_query.py 🔥 Remove Pydantic v1 specific test variants (#14611) 2025-12-27 19:19:10 +01:00
test_query_cookie_header_model_extra_params.py Drop support for Pydantic v1, keeping short temporary support for Pydantic v2's `pydantic.v1` (#14575) 2025-12-20 16:55:38 +01:00
test_read_with_orm_mode.py Drop support for `pydantic.v1` (#14609) 2025-12-27 13:54:56 +01:00
test_regex_deprecated_body.py 🐛 Update `ValidationError` schema to include `input` and `ctx` (#14791) 2026-02-04 15:34:02 +01:00
test_regex_deprecated_params.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_repeated_cookie_headers.py 🐛 Fix duplicated headers set by indirect dependencies (#1386) 2020-06-13 14:44:51 +02:00
test_repeated_dependency_schema.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_repeated_parameter_alias.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_reponse_set_reponse_code_empty.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_request_body_parameters_media_type.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_request_param_model_by_alias.py Drop support for Pydantic v1, keeping short temporary support for Pydantic v2's `pydantic.v1` (#14575) 2025-12-20 16:55:38 +01:00
test_required_noneable.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_response_by_alias.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_response_change_status_code.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_response_class_no_mediatype.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_response_code_no_body.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_response_dependency.py Allow `Response` type hint as dependency annotation (#14794) 2026-02-05 18:23:16 +00:00
test_response_model_as_return_annotation.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_response_model_data_filter.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_response_model_data_filter_no_inheritance.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_response_model_default_factory.py ️ Fix `default_factory` for response model field with Pydantic V1 (#9704) 2025-09-20 20:51:40 +02:00
test_response_model_include_exclude.py 🔧 Configure strict pytest options and update/refactor tests (#2790) 2021-07-19 21:14:58 +02:00
test_response_model_invalid.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_response_model_sub_types.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_return_none_stringified_annotations.py Allow `None` as return type for bodiless responses (#9425) 2025-09-20 18:44:43 +00:00
test_route_scope.py 🐛 Fix support for `StreamingResponse`s with dependencies with `yield` or `UploadFile`s, close after the response is done (#14099) 2025-09-29 05:29:38 +02:00
test_router_circular_import.py Show a clear error on attempt to include router into itself (#14258) 2026-02-10 11:58:40 +01:00
test_router_events.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_router_prefix_with_template.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_router_redirect_slashes.py Add allow disabling `redirect_slashes` at the FastAPI app level (#3432) 2023-06-22 10:37:50 +00:00
test_schema_compat_pydantic_v2.py Drop support for Pydantic v1, keeping short temporary support for Pydantic v2's `pydantic.v1` (#14575) 2025-12-20 16:55:38 +01:00
test_schema_extra_examples.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_schema_ref_pydantic_v2.py Drop support for Pydantic v1, keeping short temporary support for Pydantic v2's `pydantic.v1` (#14575) 2025-12-20 16:55:38 +01:00
test_security_api_key_cookie.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_api_key_cookie_description.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_api_key_cookie_optional.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_api_key_header.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_api_key_header_description.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_api_key_header_optional.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_api_key_query.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_api_key_query_description.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_api_key_query_optional.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_http_base.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_http_base_description.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_http_base_optional.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_http_basic_optional.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_http_basic_realm.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_http_basic_realm_description.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_http_bearer.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_http_bearer_description.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_http_bearer_optional.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_http_digest.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_http_digest_description.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_http_digest_optional.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_oauth2.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_oauth2_authorization_code_bearer.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_oauth2_authorization_code_bearer_description.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_oauth2_authorization_code_bearer_scopes_openapi.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_oauth2_authorization_code_bearer_scopes_openapi_simple.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_security_oauth2_optional.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_oauth2_optional_description.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_oauth2_password_bearer_optional.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_oauth2_password_bearer_optional_description.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_openid_connect.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_openid_connect_description.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_security_openid_connect_optional.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_security_scopes.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_security_scopes_dont_propagate.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_security_scopes_sub_dependency.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_serialize_response.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_serialize_response_dataclass.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_serialize_response_model.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_skip_defaults.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_sse.py Add support for Server Sent Events (#15030) 2026-03-01 10:21:52 +01:00
test_starlette_exception.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_starlette_urlconvertors.py ⬆ Bump Starlette to version `0.22.0` to fix bad encoding for query parameters in `TestClient` (#5659) 2022-11-27 15:46:06 +01:00
test_stream_bare_type.py Add support for streaming JSON Lines and binary data with `yield` (#15022) 2026-02-27 19:56:47 +01:00
test_stream_cancellation.py Add support for streaming JSON Lines and binary data with `yield` (#15022) 2026-02-27 19:56:47 +01:00
test_stream_json_validation_error.py Add support for streaming JSON Lines and binary data with `yield` (#15022) 2026-02-27 19:56:47 +01:00
test_strict_content_type_app_level.py 🔒️ Add `strict_content_type` checking for JSON requests (#14978) 2026-02-23 18:45:20 +01:00
test_strict_content_type_nested.py 🔒️ Add `strict_content_type` checking for JSON requests (#14978) 2026-02-23 18:45:20 +01:00
test_strict_content_type_router_level.py 🔒️ Add `strict_content_type` checking for JSON requests (#14978) 2026-02-23 18:45:20 +01:00
test_stringified_annotation_dependency.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_stringified_annotation_dependency_py314.py 🐛 Fix TYPE_CHECKING annotations for Python 3.14 (PEP 649) (#14789) 2026-02-04 14:49:44 +01:00
test_stringified_annotations_simple.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_sub_callbacks.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_swagger_ui_escape.py ♻️ Refactor logic to handle OpenAPI and Swagger UI escaping data (#14986) 2026-02-24 09:28:10 +00:00
test_swagger_ui_init_oauth.py 🔧 Add Flake8 linting (#1774) 2020-08-09 12:54:05 +02:00
test_top_level_security_scheme_in_openapi.py 🐛 Use `401` status code in security classes when credentials are missing (#13786) 2025-11-24 20:03:06 +01:00
test_tuples.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_typing_python39.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
test_union_body.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_union_body_discriminator.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_union_body_discriminator_annotated.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_union_forms.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_union_inherited_body.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_validate_response.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_validate_response_dataclass.py 🎨 Upgrade typing syntax for Python 3.10 (#14932) 2026-02-17 09:59:14 +00:00
test_validation_error_context.py 🚸 Improve tracebacks by adding endpoint metadata (#14306) 2025-12-06 12:21:57 +00:00
test_warn_background_tasks_overwritten.py Emit UserWarning when Response.background silently discards injected BackgroundTasks 2026-03-14 14:08:25 +08:00
test_webhooks_security.py Add inline snapshot tests for OpenAPI before changes from Pydantic v2 (#14864) 2026-02-08 10:18:38 +00:00
test_wrapped_method_forward_reference.py Add support for wrapped functions (e.g. `@functools.wraps()`) used with forward references (#5077) 2025-12-02 18:23:14 +01:00
test_ws_dependencies.py ♻️ Upgrade internal syntax to Python 3.9+ 🎉 (#14564) 2025-12-17 21:25:59 +00:00
test_ws_router.py Add exception handler for `WebSocketRequestValidationError` (which also allows to override it) (#6030) 2023-06-11 21:08:14 +02:00
utils.py 🔨 Run tests with `pytest-xdist` and `pytest-cov` (#14992) 2026-02-27 11:53:47 +01:00