Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(warnings): Do not warn for default handlers #3569

Conversation

Alc-Alc
Copy link
Contributor

@Alc-Alc Alc-Alc commented Jun 15, 2024

Description

  • The warning being applied to the default handlers was unintended behavior due to subclassing. This PR establishes the intended behavior by defining separate __init_subclass__es for the default handlers.

Closes

Closes #3552

@github-actions github-actions bot added area/docs This PR involves changes to the documentation size: small type/bug pr/internal labels Jun 15, 2024
@Alc-Alc
Copy link
Contributor Author

Alc-Alc commented Jun 15, 2024

Should a test be added in https://github.com/litestar-org/litestar/blob/f179aee0ff9946c96eed4c6b1a8d91181021ff6a/tests/unit/test_handlers/test_http_handlers/test_deprecation.py that tests warnings are not emitted for defaults handlers?

Added a test that fails in current main, but not on this branch

Copy link

codecov bot commented Jun 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.28%. Comparing base (f179aee) to head (407332f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3569   +/-   ##
=======================================
  Coverage   98.27%   98.28%           
=======================================
  Files         328      328           
  Lines       14824    14835   +11     
  Branches     2362     2362           
=======================================
+ Hits        14569    14580   +11     
  Misses        116      116           
  Partials      139      139           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Jun 15, 2024

Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3569

@provinzkraut provinzkraut merged commit 064c8fe into main Jun 15, 2024
26 checks passed
@provinzkraut provinzkraut deleted the 3552-bug-normal-usage-of-route-handler-decorators-causes-deprecation-warnings branch June 15, 2024 09:38
provinzkraut pushed a commit that referenced this pull request Jun 21, 2024
* fix(warnings): Do not warn for default handlers
* test: add test to check (lack of) warnings

---------

Co-authored-by: Alc-Alc <alc@localhost>
(cherry picked from commit 064c8fe)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs This PR involves changes to the documentation pr/internal size: small type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: normal usage of route handler decorators causes deprecation warnings
2 participants