Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit caf8f42

Browse files
committed
Add cached_property tests
1 parent fc8a1d4 commit caf8f42

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/tests/test_cases/test.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# No docstring, so we can test D100
2-
from functools import wraps
2+
import functools
3+
from functools import cached_property, wraps
34
import os
45
from .expected import Expectation
56
from typing import overload
@@ -47,6 +48,16 @@ def foo(self):
4748
"""The foo of the thing, which isn't in imperitive mood."""
4849
return "hello"
4950

51+
@cached_property
52+
def bar(self):
53+
"""The bar of the thing, which also isn't in imperitive mood."""
54+
return "bye"
55+
56+
@functools.cached_property
57+
def foobar(self):
58+
"""The foobar of the thing; not in imperitive mood."""
59+
return "hello again"
60+
5061
@expect('D102: Missing docstring in public method')
5162
def __new__(self=None):
5263
pass

0 commit comments

Comments
 (0)