Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 2bc0b420 authored by Dorian Turba's avatar Dorian Turba
Browse files

await coroutine

parent e025e4f7
No related branches found
No related tags found
No related merge requests found
Pipeline #23961 failed
...@@ -134,14 +134,14 @@ def test_rollback_commit_rollback( ...@@ -134,14 +134,14 @@ def test_rollback_commit_rollback(
@pytest.mark.asyncio @pytest.mark.asyncio
@pytest.mark.parametrize(["name1", "name2"], [["Joe", "Jane"], ["Jane", "Joe"]]) @pytest.mark.parametrize(["name1", "name2"], [["Joe", "Jane"], ["Jane", "Joe"]])
async def async_test_rollback_commit_rollback( async def test_async_rollback_commit_rollback(
async_create_user_rollback_commit_rollback, async_create_user_rollback_commit_rollback,
user_model, user_model,
async_fake_session_maker, async_fake_session_maker,
name1, name1,
name2, name2,
): ):
async_create_user_rollback_commit_rollback(name1, name2) await async_create_user_rollback_commit_rollback(name1, name2)
stmt = sqlalchemy.select(user_model.name) stmt = sqlalchemy.select(user_model.name)
async with async_fake_session_maker() as session: async with async_fake_session_maker() as session:
...@@ -149,7 +149,7 @@ async def async_test_rollback_commit_rollback( ...@@ -149,7 +149,7 @@ async def async_test_rollback_commit_rollback(
names = query.all() names = query.all()
assert names == [name2] assert names == [name2]
async_create_user_rollback_commit_rollback(name1, name2) await async_create_user_rollback_commit_rollback(name1, name2)
stmt = sqlalchemy.select(user_model.name) stmt = sqlalchemy.select(user_model.name)
async with async_fake_session_maker() as session: async with async_fake_session_maker() as session:
query = await session.scalars(stmt) query = await session.scalars(stmt)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment