Skip to content

fix: add support for PEP 585 type hinting for 3.9+ #199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from
Prev Previous commit
Next Next commit
fix
  • Loading branch information
YunchuWang committed Dec 21, 2023
commit 5c02cbaf6ea0cd99afb34508f9bf71755ac02641
6 changes: 3 additions & 3 deletions tests/test_eventgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MyTestCase(unittest.TestCase):
def test_eventgrid_input_type(self):
check_input_type = azf_event_grid.EventGridEventInConverter.\
check_input_type_annotation

if sys.version_info >= (3, 9):
self.assertTrue(check_input_type(list[func.EventGridEvent]))

Expand All @@ -26,11 +26,11 @@ def test_eventgrid_input_type(self):
def test_eventgrid_output_type(self):
check_output_type = azf_event_grid.EventGridEventOutConverter.\
check_output_type_annotation

if sys.version_info >= (3, 9):
self.assertTrue(check_output_type(list[func.EventGridEvent]))
self.assertTrue(check_output_type(list[str]))

self.assertTrue(check_output_type(func.EventGridOutputEvent))
self.assertTrue(check_output_type(List[func.EventGridOutputEvent]))
self.assertTrue(check_output_type(str))
Expand Down
10 changes: 5 additions & 5 deletions tests/test_eventhub.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def test_eventhub_input_type(self):
azf_eh.EventHubConverter.check_input_type_annotation
)
if sys.version_info >= (3, 9):
self.assertTrue(check_input_type(list[func.EventGridEvent]))
self.assertTrue(check_input_type(list[str]))
self.assertTrue(check_input_type(list[func.EventGridEvent]))
self.assertTrue(check_input_type(list[str]))

self.assertTrue(check_input_type(func.EventHubEvent))
self.assertTrue(check_input_type(List[func.EventHubEvent]))
Expand All @@ -38,9 +38,9 @@ def test_eventhub_output_type(self):
)

if sys.version_info >= (3, 9):
self.assertTrue(check_output_type(list[func.EventGridEvent]))
self.assertTrue(check_output_type(list[str]))
self.assertTrue(check_output_type(list[func.EventGridEvent]))
self.assertTrue(check_output_type(list[str]))

self.assertTrue(check_output_type(bytes))
self.assertTrue(check_output_type(str))
self.assertTrue(check_output_type(List[str]))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_kafka_input_type(self):
if sys.version_info >= (3, 9):
self.assertTrue(check_input_type(list[func.KafkaEvent]))
self.assertTrue(check_input_type(list[str]))

self.assertTrue(check_input_type(func.KafkaEvent))
self.assertTrue(check_input_type(List[func.KafkaEvent]))
self.assertFalse(check_input_type(str))
Expand Down