diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-01-23 10:51:55 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-01-23 12:58:38 -0500 |
| commit | aba3ab247da4628e4e7baf993702e2efaccbc547 (patch) | |
| tree | 5aede9a6a560c3184ca0b2a86b3ad3d5715370d6 /lib/sqlalchemy/pool/base.py | |
| parent | 321f64f71e7ecc7404da9b95e2e0aa1d692ac181 (diff) | |
| download | sqlalchemy-aba3ab247da4628e4e7baf993702e2efaccbc547.tar.gz | |
after all that, use pytest warnings plugin
The warnings plugin lets us set the filters up
in the config, and as our filter requirements are now
simple we can just set this up.
additionally pytest now recommends pyproject.toml, since
we fully include this now, let's move it there.
the pytest logging plugin seems to not be any problem either
at the moment, so re-enable that. if it becomes apparent
whatever the problem was (which was probably that it was just
surprising, or something) we can disable it again and comment
what the reason was.
Change-Id: Ia9715533b01f72aa5fdcf6a27ce75b76f829fa43
Diffstat (limited to 'lib/sqlalchemy/pool/base.py')
| -rw-r--r-- | lib/sqlalchemy/pool/base.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/sqlalchemy/pool/base.py b/lib/sqlalchemy/pool/base.py index 0512582f8..6c770e201 100644 --- a/lib/sqlalchemy/pool/base.py +++ b/lib/sqlalchemy/pool/base.py @@ -757,13 +757,14 @@ def _finalize_fairy( else: message = ( "The garbage collector is trying to clean up " - "connection %r. This feature is unsupported on async " + f"connection {dbapi_connection!r}. This feature is " + "unsupported on async " "dbapi, since no IO can be performed at this stage to " "reset the connection. Please close out all " "connections when they are no longer used, calling " "``close()`` or using a context manager to " "manage their lifetime." - ) % dbapi_connection + ) pool.logger.error(message) util.warn(message) @@ -779,6 +780,14 @@ def _finalize_fairy( if connection_record and connection_record.fairy_ref is not None: connection_record.checkin() + # give gc some help. See + # test/engine/test_pool.py::PoolEventsTest::test_checkin_event_gc[True] + # which actually started failing when pytest warnings plugin was + # turned on, due to util.warn() above + del dbapi_connection + del connection_record + del fairy + # a dictionary of the _ConnectionFairy weakrefs to _ConnectionRecord, so that # GC under pypy will call ConnectionFairy finalizers. linked directly to the |
