From 2665a0c4cb3e94e6545d0b9bbcbcc39ccffebaba Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 8 Oct 2020 15:20:48 -0400 Subject: generalize scoped_session proxying and apply to asyncio elements Reworked the proxy creation used by scoped_session() to be based on fully copied code with augmented docstrings and moved it into langhelpers. asyncio session, engine, connection can now take advantage of it so that all non-async methods are availble. Overall implementation of most important accessors / methods on AsyncConnection, etc. , including awaitable versions of invalidate, execution_options, etc. In order to support an event dispatcher on the async classes while still allowing them to hold __slots__, make some adjustments to the event system to allow that to be present, at least rudimentally. Fixes: #5628 Change-Id: I5eb6929fc1e4fdac99e4b767dcfd49672d56e2b2 --- lib/sqlalchemy/testing/plugin/pytestplugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/testing/plugin') diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py index dfefd3b95..644ea6dc2 100644 --- a/lib/sqlalchemy/testing/plugin/pytestplugin.py +++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py @@ -372,7 +372,7 @@ def _pytest_fn_decorator(target): if add_positional_parameters: spec.args.extend(add_positional_parameters) - metadata = dict(target="target", fn="fn", name=fn.__name__) + metadata = dict(target="target", fn="__fn", name=fn.__name__) metadata.update(format_argspec_plus(spec, grouped=False)) code = ( """\ @@ -382,7 +382,7 @@ def %(name)s(%(args)s): % metadata ) decorated = _exec_code_in_env( - code, {"target": target, "fn": fn}, fn.__name__ + code, {"target": target, "__fn": fn}, fn.__name__ ) if not add_positional_parameters: decorated.__defaults__ = getattr(fn, "__func__", fn).__defaults__ -- cgit v1.2.1