summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/plugin/plugin_base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-04-05 19:00:19 -0400
committermike bayer <mike_mp@zzzcomputing.com>2022-04-12 02:09:42 +0000
commit98eae4e181cb2d1bbc67ec834bfad29dcba7f461 (patch)
treefc000c3113a4a198b4ddd6bc81fe291dc9ef1ffb /lib/sqlalchemy/testing/plugin/plugin_base.py
parent15ef11e0ede82e44fb07f31b63d3db0712d8bf48 (diff)
downloadsqlalchemy-98eae4e181cb2d1bbc67ec834bfad29dcba7f461.tar.gz
use code generation for scoped_session
our decorator thing generates code in any case, so point it at the file itself to generate real code for the blocks rather than doing things dynamically. this will allow typing tools to have no problem whatsoever and we also reduce import time overhead. file size will be a lot bigger though, shrugs. syntax / dupe method / etc. checking will be accomplished by our existing linting / typing / formatting tools. As we are also using "from __future__ import annotations", we also no longer have to apply quotes to generated annotations. Change-Id: I20962cb65bda63ff0fb67357ab346e9b1ef4f108
Diffstat (limited to 'lib/sqlalchemy/testing/plugin/plugin_base.py')
-rw-r--r--lib/sqlalchemy/testing/plugin/plugin_base.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py
index 52e42bb97..b90858512 100644
--- a/lib/sqlalchemy/testing/plugin/plugin_base.py
+++ b/lib/sqlalchemy/testing/plugin/plugin_base.py
@@ -5,14 +5,8 @@
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
-"""Testing extensions.
-
-this module is designed to work as a testing-framework-agnostic library,
-created so that multiple test frameworks can be supported at once
-(mostly so that we can migrate to new ones). The current target
-is pytest.
+from __future__ import annotations
-"""
import abc
import configparser
import logging
@@ -23,6 +17,15 @@ from typing import Any
from sqlalchemy.testing import asyncio
+"""Testing extensions.
+
+this module is designed to work as a testing-framework-agnostic library,
+created so that multiple test frameworks can be supported at once
+(mostly so that we can migrate to new ones). The current target
+is pytest.
+
+"""
+
# flag which indicates we are in the SQLAlchemy testing suite,
# and not that of Alembic or a third party dialect.
bootstrapped_as_sqlalchemy = False