Skip to content

Commit

Permalink
Revert "trace_class add tracing for classmethod and staticmethdod (#115
Browse files Browse the repository at this point in the history
…)"

This reverts commit 5a6fc08. But leaves some of the tests.
  • Loading branch information
EeroPaukkonen committed Aug 9, 2023
1 parent 39c0736 commit 09bc70e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/tracing/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ async def adummy_property(self) -> None:
"class_attr",
[
A.dummy_method,
A.adummy_staticmethod,
A.dummy_classmethod,
A.adummy_method,
A.adummy_staticmethod,
A.adummy_classmethod,
],
)
def test_trace_class_is_traced(class_attr: Any) -> None:
Expand All @@ -66,6 +62,10 @@ def test_trace_class_is_traced(class_attr: Any) -> None:
A._dummy_underscore,
A.dummy_property,
A.adummy_property,
A.adummy_staticmethod,
A.adummy_classmethod,
A.adummy_staticmethod,
A.dummy_classmethod,
],
)
def test_trace_class_is_not_traced(class_attr: Any) -> None:
Expand Down
5 changes: 1 addition & 4 deletions troncos/tracing/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,7 @@ def _class_decorator(cls: Type[TClass]) -> Type[TClass]:
if key.startswith("_"):
continue
if not (
isinstance(value, FunctionType)
or isinstance(value, classmethod)
or isinstance(value, staticmethod)
or asyncio.iscoroutinefunction(value)
isinstance(value, FunctionType) or asyncio.iscoroutinefunction(value)
):
continue

Expand Down

0 comments on commit 09bc70e

Please sign in to comment.