Skip to content

Commit

Permalink
feat: add future flag to experimental_features (#3864)
Browse files Browse the repository at this point in the history
  • Loading branch information
cofin authored Nov 21, 2024
1 parent 06024fe commit 7194dcf
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 @@ -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."""
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 7194dcf

Please sign in to comment.