-
-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Remove test for warnings when subclassing route handler decorat…
…ors (#3529) Remove deprecated test
- Loading branch information
1 parent
f17e373
commit 8910ceb
Showing
1 changed file
with
0 additions
and
28 deletions.
There are no files selected for viewing
28 changes: 0 additions & 28 deletions
28
tests/unit/test_handlers/test_http_handlers/test_deprecation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +0,0 @@ | ||
from __future__ import annotations | ||
|
||
from importlib import reload | ||
from warnings import catch_warnings, simplefilter | ||
|
||
import pytest | ||
|
||
from litestar.handlers import delete, get, head, patch, post, put | ||
|
||
|
||
@pytest.mark.parametrize("handler_cls", [get, post, put, patch, delete, head]) | ||
def test_subclass_warns_deprecation(handler_cls: get | post | put | patch | delete | head) -> None: | ||
with pytest.warns(DeprecationWarning): | ||
|
||
class SubClass(handler_cls): # type: ignore[valid-type, misc] | ||
pass | ||
|
||
|
||
def test_default_no_warns() -> None: | ||
with catch_warnings(record=True) as warnings: | ||
simplefilter("always") | ||
import litestar.handlers.http_handlers.decorators | ||
|
||
reload(litestar.handlers.http_handlers.decorators) | ||
assert len(warnings) == 0 | ||
|
||
# revert to previous filter | ||
simplefilter("default") | ||