diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-04-30 18:27:24 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-05-09 20:23:48 -0400 |
| commit | 60b31198311eedfa3814e7098c94d3aa29338fdd (patch) | |
| tree | 5fe3a55ef67ab14fa63a0a3122a1326b830ceb72 /lib/sqlalchemy/dialects | |
| parent | 228490ead7048f2e558c25b0f055bdb952272ec4 (diff) | |
| download | sqlalchemy-60b31198311eedfa3814e7098c94d3aa29338fdd.tar.gz | |
fix test suite warnings
fix a handful of warnings that were emitting but not raising,
usually because they were inside an "expect_warnings" block.
modify "expect_warnings" to always use "raise_on_any_unexpected"
behavior; remove this parameter.
Fixed issue in semi-private ``await_only()`` and ``await_fallback()``
concurrency functions where the given awaitable would remain un-awaited if
the function threw a ``GreenletError``, which could cause "was not awaited"
warnings later on if the program continued. In this case, the given
awaitable is now cancelled before the exception is thrown.
Change-Id: I33668c5e8c670454a3d879e559096fb873b57244
Diffstat (limited to 'lib/sqlalchemy/dialects')
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/asyncpg.py | 1 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/sqlite/aiosqlite.py | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/asyncpg.py b/lib/sqlalchemy/dialects/postgresql/asyncpg.py index c879205e4..d198620d3 100644 --- a/lib/sqlalchemy/dialects/postgresql/asyncpg.py +++ b/lib/sqlalchemy/dialects/postgresql/asyncpg.py @@ -850,6 +850,7 @@ class AsyncAdapt_asyncpg_connection(AdaptedConnection): def terminate(self): self._connection.terminate() + self._started = False @staticmethod def _default_name_func(): diff --git a/lib/sqlalchemy/dialects/sqlite/aiosqlite.py b/lib/sqlalchemy/dialects/sqlite/aiosqlite.py index f9c60efc1..2981976ac 100644 --- a/lib/sqlalchemy/dialects/sqlite/aiosqlite.py +++ b/lib/sqlalchemy/dialects/sqlite/aiosqlite.py @@ -239,6 +239,16 @@ class AsyncAdapt_aiosqlite_connection(AdaptedConnection): def close(self): try: self.await_(self._connection.close()) + except ValueError: + # this is undocumented for aiosqlite, that ValueError + # was raised if .close() was called more than once, which is + # both not customary for DBAPI and is also not a DBAPI.Error + # exception. This is now fixed in aiosqlite via my PR + # https://github.com/omnilib/aiosqlite/pull/238, so we can be + # assured this will not become some other kind of exception, + # since it doesn't raise anymore. + + pass except Exception as error: self._handle_exception(error) |
