File tree Expand file tree Collapse file tree 1 file changed +2
-23
lines changed Expand file tree Collapse file tree 1 file changed +2
-23
lines changed Original file line number Diff line number Diff line change 1
- from typing import get_type_hints
2
1
import pytest
3
2
from py_spring .core .utils import (
4
3
check_type_hints_for_callable ,
@@ -108,26 +107,6 @@ def test_class_with_method_having_no_type_hints(self):
108
107
check_type_hints_for_class (TestClassWithNotArsAndReturnTyped )
109
108
110
109
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 )
133
110
check_type_hints_for_class (TestClassWithVariableInside )
111
+
112
+
You can’t perform that action at this time.
0 commit comments