Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tests/test_Task__parse_annotation_for_metaclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_parse_annotation_for_metaclass(self):
def dummy_function(inputa :Annotated[str, A]) -> None: pass

expected_result = ['inputa'] # 'return' is the annotation name for function return type
parsed_annotations = _parse_annotation_for_metaclass(dummy_function, A)
parsed_annotations = _parse_annotation_for_metaclass(dummy_function, {}, A)
self.assertEqual(parsed_annotations, expected_result)

def test_parse_annotation_for_metaclass_return(self):
Expand All @@ -26,15 +26,15 @@ def test_parse_annotation_for_metaclass_return(self):
def dummy_function() -> Annotated[str, A]: pass

expected_result = ['return'] # 'return' is the annotation name for function return type
parsed_annotations = _parse_annotation_for_metaclass(dummy_function, A)
parsed_annotations = _parse_annotation_for_metaclass(dummy_function, {}, A)
self.assertEqual(parsed_annotations, expected_result)

def test_parse_annotation_for_metaclass_no_args(self):
"""Test _parse_annotation_for_metaclass"""

def dummy_function() -> None: pass

parsed_annotations = _parse_annotation_for_metaclass(dummy_function, A)
parsed_annotations = _parse_annotation_for_metaclass(dummy_function, {}, A)
self.assertEqual(parsed_annotations, [])

def test_parse_annotation_for_metaclass_no_metaclass(self):
Expand All @@ -43,15 +43,15 @@ def test_parse_annotation_for_metaclass_no_metaclass(self):
# Change metaclass in function annotation
def dummy_function() -> Annotated[str, list]: pass

parsed_annotations = _parse_annotation_for_metaclass(dummy_function, A)
parsed_annotations = _parse_annotation_for_metaclass(dummy_function, {}, A)
self.assertEqual(parsed_annotations, [])

def test_parse_annotation_for_metaclass_no_annotations(self):
"""Test _parse_annotation_for_metaclass when no function annotations"""

def dummy_function(a, b): pass # No type annotations

parsed_annotations = _parse_annotation_for_metaclass(dummy_function, A)
parsed_annotations = _parse_annotation_for_metaclass(dummy_function, {}, A)
self.assertEqual(parsed_annotations, [])


Expand Down