forked from loafle/openapi-generator-original
Test with Python 3.11 (#16649)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user