Skip to content

Commit

Permalink
feat: add future flag to experimental_features
Browse files Browse the repository at this point in the history
  • Loading branch information
cofin committed Nov 17, 2024
1 parent a2b8e48 commit ad32e1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions litestar/config/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,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."""
5 changes: 5 additions & 0 deletions tests/unit/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down

0 comments on commit ad32e1c

Please sign in to comment.