Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dstandish committed Nov 13, 2024
1 parent f9466ec commit 620902e
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions tests/utils/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from sqlalchemy import select

from airflow.models import Log
from airflow.settings import create_async_session
from airflow.utils.session import provide_session

pytestmark = [pytest.mark.db_test, pytest.mark.skip_if_database_isolation_mode]
Expand Down Expand Up @@ -57,12 +56,12 @@ def test_provide_session_with_kwargs(self):
session = object()
assert wrapper(session=session) is session

@pytest.mark.asyncio
async def test_async_session(self):
from airflow.settings import create_async_session

@pytest.mark.asyncio
@pytest.mark.db_test
async def test_async_session():
session = create_async_session()
session.add(Log(event="hihi1234"))
await session.commit()
l = await session.scalar(select(Log).where(Log.event == "hihi1234").limit(1)) # noqa: E741
assert l.event == "hihi1234"
session = create_async_session()
session.add(Log(event="hihi1234"))
await session.commit()
l = await session.scalar(select(Log).where(Log.event == "hihi1234").limit(1)) # noqa: E741
assert l.event == "hihi1234"

0 comments on commit 620902e

Please sign in to comment.