Test with Python 3.11 (#16649)

This commit is contained in:
Jonathan Ballet
2023-09-23 07:09:11 +02:00
committed by GitHub
parent 2ca99bdf8e
commit e892d50075
3 changed files with 11 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
#- "3.11"
- "3.11"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4

View File

@@ -19,7 +19,7 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
#- "3.11"
- "3.11"
sample:
- samples/openapi3/client/petstore/python-aiohttp
- samples/openapi3/client/petstore/python

View File

@@ -70,12 +70,17 @@ class TestPetApiTests(unittest.TestCase):
async def test_async_with_result(self):
await self.pet_api.add_pet(self.pet)
calls = [self.pet_api.get_pet_by_id(self.pet.id),
self.pet_api.get_pet_by_id(self.pet.id)]
tasks = [
asyncio.create_task(coro)
for coro in [
self.pet_api.get_pet_by_id(self.pet.id),
self.pet_api.get_pet_by_id(self.pet.id),
]
]
responses, _ = await asyncio.wait(calls)
responses = await asyncio.gather(*tasks)
for response in responses:
self.assertEqual(response.result().id, self.pet.id)
self.assertEqual(response.id, self.pet.id)
self.assertEqual(len(responses), 2)
@async_test