Skip to content

Commit 9f6f626

Browse files
chore: remove debug code
1 parent 9b74729 commit 9f6f626

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

tests/test_utils.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from typing import get_type_hints
21
import pytest
32
from py_spring.core.utils import (
43
check_type_hints_for_callable,
@@ -108,26 +107,6 @@ def test_class_with_method_having_no_type_hints(self):
108107
check_type_hints_for_class(TestClassWithNotArsAndReturnTyped)
109108

110109
def test_class_with_method_having_variable_inside(self):
111-
# with pytest.raises(
112-
# TypeHintError
113-
# ):
114-
RETURN_ID = "return"
115-
func = TestClassWithVariableInside.method
116-
func_qualname_list = func.__qualname__.split(".")
117-
is_class_callable = True if len(func_qualname_list) == 2 else False
118-
class_name = func_qualname_list[0] if is_class_callable else ""
119-
120-
func_name = func.__name__
121-
args_type_hints = get_type_hints(func)
122-
123-
if RETURN_ID not in args_type_hints:
124-
raise TypeHintError(
125-
f"Type hints for 'return type' not provided for the function: {class_name}.{func_name}"
126-
)
127-
128-
# plue one is for return type, return type is not included in co_argcount if it is a simple function,
129-
# for member functions, self is included in co_varnames, but not in type hints, so plus 0
130-
arguments = [_arg for _arg in func.__annotations__ if _arg != RETURN_ID]
131-
132-
argument_count = len(arguments) + (0 if is_class_callable else 1)
133110
check_type_hints_for_class(TestClassWithVariableInside)
111+
112+

0 commit comments

Comments
 (0)