From 7194dcf89a4e076d3f46c94166841d00a4924e54 Mon Sep 17 00:00:00 2001 From: Cody Fincher <204685+cofin@users.noreply.github.com> Date: Thu, 21 Nov 2024 13:58:05 -0600 Subject: [PATCH] feat: add `future` flag to `experimental_features` (#3864) --- litestar/config/app.py | 3 +++ tests/unit/test_app.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/litestar/config/app.py b/litestar/config/app.py index a314b9e9e3..170598a422 100644 --- a/litestar/config/app.py +++ b/litestar/config/app.py @@ -230,3 +230,6 @@ def __post_init__(self) -> None: class ExperimentalFeatures(str, enum.Enum): DTO_CODEGEN = "DTO_CODEGEN" + """Enable DTO codegen.""" + FUTURE = "FUTURE" + """Enable future features that may be considered breaking or changing.""" diff --git a/tests/unit/test_app.py b/tests/unit/test_app.py index 87a779628c..084e0572fa 100644 --- a/tests/unit/test_app.py +++ b/tests/unit/test_app.py @@ -454,6 +454,11 @@ def test_use_dto_codegen_feature_flag_warns() -> None: Litestar(experimental_features=[ExperimentalFeatures.DTO_CODEGEN]) +def test_use_future_feature_flag_warns() -> None: + app = Litestar(experimental_features=[ExperimentalFeatures.FUTURE]) + assert app.experimental_features == frozenset([ExperimentalFeatures.FUTURE]) + + def test_using_custom_path_parameter() -> None: @get() def my_route_handler() -> None: ...