Skip to content

Commit

Permalink
test: Remove test for warnings when subclassing route handler decorat…
Browse files Browse the repository at this point in the history
…ors (#3529)

Remove deprecated test
  • Loading branch information
provinzkraut committed Jun 21, 2024
1 parent f17e373 commit 8910ceb
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions tests/unit/test_handlers/test_http_handlers/test_deprecation.py
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")

0 comments on commit 8910ceb

Please sign in to comment.