-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
________________________ test_wrapper_attributes[None] _________________________
size = None
@pytest.mark.parametrize("size", [None, 0, 10, 128])
def test_wrapper_attributes(size: "int | None"):
class Bar:
@a.lru_cache
async def method(self, int_arg: int):
"""Method docstring"""
@a.lru_cache
async def other_method(self):
"""Method docstring"""
assert Bar.method.__doc__ == """Method docstring"""
for name in ("method", "other_method"):
for cache in (getattr(Bar, name), getattr(Bar(), name)):
assert cache.__doc__ == """Method docstring"""
assert cache.__name__ == name
assert cache.__qualname__.endswith(f"Bar.{name}")
if name != "method":
continue
# test direct and literal annotation styles
> assert Bar.method.__annotations__["int_arg"] in {int, "int"}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E KeyError: 'int_arg'
unittests/test_functools_lru.py:178: KeyError
Minimal Reproducible Example
Request Assignment [Optional]
- I already understand the cause and want to submit a bugfix.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working