diff --git a/src/pluggy/_manager.py b/src/pluggy/_manager.py index 843fef8a..e9905ccd 100644 --- a/src/pluggy/_manager.py +++ b/src/pluggy/_manager.py @@ -45,10 +45,11 @@ def _warn_for_function(warning: Warning, function: Callable[..., object]) -> Non filename=func.__code__.co_filename, ) + def _attr_is_property(obj: Any, name: str) -> bool: """Check if a given attr is a @property on a module, class, or object""" if inspect.ismodule(obj): - return False # modules can never have @property methods + return False # modules can never have @property methods base_class = obj if inspect.isclass(obj) else type(obj) if isinstance(getattr(base_class, name, None), property): diff --git a/testing/test_pluginmanager.py b/testing/test_pluginmanager.py index 40dd56fe..d412f7a5 100644 --- a/testing/test_pluginmanager.py +++ b/testing/test_pluginmanager.py @@ -4,7 +4,6 @@ import importlib.metadata from typing import Any -from typing import Dict from typing import List import pytest @@ -130,8 +129,8 @@ class ClassWithProperties: @property def some_func(self): - self.property_was_executed = True # pragma: no cover - return None # pragma: no cover + self.property_was_executed = True # pragma: no cover + return None # pragma: no cover test_plugin = ClassWithProperties() he_pm.register(test_plugin)