diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2021-12-27 15:26:31 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-12-27 15:26:31 +0000 |
| commit | 4a12848a1cf47ed43c93c5ee8029b644242d0a17 (patch) | |
| tree | 233c3862dc5734becb9ed2d9cf7f95a71382de77 /lib/sqlalchemy/testing/plugin/plugin_base.py | |
| parent | 2bb6cfc7c9b8f09eaa4efeffc337a1162993979c (diff) | |
| parent | e6cd36fc51d25922f20aa203229a636f5d6daabe (diff) | |
| download | sqlalchemy-4a12848a1cf47ed43c93c5ee8029b644242d0a17.tar.gz | |
Merge "implement cython for cache_anon_map, prefix_anon_map" into main
Diffstat (limited to 'lib/sqlalchemy/testing/plugin/plugin_base.py')
| -rw-r--r-- | lib/sqlalchemy/testing/plugin/plugin_base.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py index 7bc88a14b..2a6691fc8 100644 --- a/lib/sqlalchemy/testing/plugin/plugin_base.py +++ b/lib/sqlalchemy/testing/plugin/plugin_base.py @@ -16,6 +16,7 @@ is pytest. import abc import configparser import logging +import os import re import sys @@ -370,6 +371,20 @@ def _monkeypatch_cdecimal(options, file_config): @post +def __ensure_cext(opt, file_config): + if os.environ.get("REQUIRE_SQLALCHEMY_CEXT", "0") == "1": + from sqlalchemy.util import has_compiled_ext + + try: + has_compiled_ext(raise_=True) + except ImportError as err: + raise AssertionError( + "REQUIRE_SQLALCHEMY_CEXT is set but can't import the " + "cython extensions" + ) from err + + +@post def _init_symbols(options, file_config): from sqlalchemy.testing import config |
