test: add test cases for decorators

This commit is contained in:
disrupted 2025-03-11 22:47:35 +01:00
parent 5c31d37bd7
commit 11d2f67baa
No known key found for this signature in database
2 changed files with 22 additions and 7 deletions

View file

@ -0,0 +1,22 @@
from dataclasses import dataclass
@dataclass
#^^^^^^^^^ @attribute
class Data:
_foo: str
@property
# ^ @attribute
# ^^^^^^^^ @attribute.builtin
def foo(self) -> str:
return self._foo
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
#^^^^^^ @variable
# ^^^^ @variable.member
# ^^^^^^^^^^^^^^ @attribute
def test_func():
pass

View file

@ -11,10 +11,3 @@ class Foo:
Foo().method()
# ^^^^^^ @function.method.call
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
#^^^^^^ @variable
# ^^^^ @variable.member
# ^^^^^^^^^^^^^^ @function.method.call
def test_func():
pass