diff options
author | Federico Caselli <cfederico87@gmail.com> | 2021-08-26 22:00:33 +0200 |
---|---|---|
committer | Federico Caselli <cfederico87@gmail.com> | 2021-08-26 22:00:58 +0200 |
commit | f02349336fa4470dbb5ca8e4d16031b8aa86a74a (patch) | |
tree | 0cacf340d84e198e64b30ca14a015a4a4973caf5 /test/ext/asyncio/test_session_py3k.py | |
parent | e2d9ef3fe6f7bd9b151caf71ae5eb7f15522ec8c (diff) | |
download | sqlalchemy-f02349336fa4470dbb5ca8e4d16031b8aa86a74a.tar.gz |
Handle mappings passed to ``execution_options``.
Fixed a bug in :meth:`_asyncio.AsyncSession.execute` and
:meth:`_asyncio.AsyncSession.stream` that required ``execution_options``
to be an instance of ``immutabledict`` when defined. It now
correctly accepts any mapping.
Fixes: #6943
Change-Id: Ic09de480dc2da1b0bdce25acb60b8f01371971f9
Diffstat (limited to 'test/ext/asyncio/test_session_py3k.py')
-rw-r--r-- | test/ext/asyncio/test_session_py3k.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/test/ext/asyncio/test_session_py3k.py b/test/ext/asyncio/test_session_py3k.py index 0883cb026..ebedfedbf 100644 --- a/test/ext/asyncio/test_session_py3k.py +++ b/test/ext/asyncio/test_session_py3k.py @@ -65,7 +65,10 @@ class AsyncSessionTest(AsyncFixture): class AsyncSessionQueryTest(AsyncFixture): @async_test - async def test_execute(self, async_session): + @testing.combinations( + {}, dict(execution_options={"logging_token": "test"}), argnames="kw" + ) + async def test_execute(self, async_session, kw): User = self.classes.User stmt = ( @@ -74,7 +77,7 @@ class AsyncSessionQueryTest(AsyncFixture): .order_by(User.id) ) - result = await async_session.execute(stmt) + result = await async_session.execute(stmt, **kw) eq_(result.scalars().all(), self.static.user_address_result) @async_test @@ -103,7 +106,10 @@ class AsyncSessionQueryTest(AsyncFixture): @async_test @testing.requires.independent_cursors - async def test_stream_partitions(self, async_session): + @testing.combinations( + {}, dict(execution_options={"logging_token": "test"}), argnames="kw" + ) + async def test_stream_partitions(self, async_session, kw): User = self.classes.User stmt = ( @@ -112,7 +118,7 @@ class AsyncSessionQueryTest(AsyncFixture): .order_by(User.id) ) - result = await async_session.stream(stmt) + result = await async_session.stream(stmt, **kw) assert_result = [] async for partition in result.scalars().partitions(3): |