summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/plugin
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2021-12-27 15:26:31 +0000
committerGerrit Code Review <gerrit@ci3.zzzcomputing.com>2021-12-27 15:26:31 +0000
commit4a12848a1cf47ed43c93c5ee8029b644242d0a17 (patch)
tree233c3862dc5734becb9ed2d9cf7f95a71382de77 /lib/sqlalchemy/testing/plugin
parent2bb6cfc7c9b8f09eaa4efeffc337a1162993979c (diff)
parente6cd36fc51d25922f20aa203229a636f5d6daabe (diff)
downloadsqlalchemy-4a12848a1cf47ed43c93c5ee8029b644242d0a17.tar.gz
Merge "implement cython for cache_anon_map, prefix_anon_map" into main
Diffstat (limited to 'lib/sqlalchemy/testing/plugin')
-rw-r--r--lib/sqlalchemy/testing/plugin/plugin_base.py15
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