diff options
| author | Federico Caselli <cfederico87@gmail.com> | 2023-03-15 21:49:13 +0100 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-03-17 09:43:57 -0400 |
| commit | 1a5f0c0be11fa30296f20a1742807a57e2ff5459 (patch) | |
| tree | 46de8b365636d23c408d349cc2931d3bf62a568f /lib/sqlalchemy/testing | |
| parent | e8baf5aa010ce7e3dea9b0ccf5e8b0b90f4310ad (diff) | |
| download | sqlalchemy-1a5f0c0be11fa30296f20a1742807a57e2ff5459.tar.gz | |
Improved wheel pipeline
- ensure that the compiled extensions are used
- speed up job by parallelizing more
Fixes: #9434
Change-Id: Ief750b28733ba24bb5ff8c105e1a4c9b7b928700
Diffstat (limited to 'lib/sqlalchemy/testing')
| -rw-r--r-- | lib/sqlalchemy/testing/plugin/pytestplugin.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py index d590ecbe4..b5d248552 100644 --- a/lib/sqlalchemy/testing/plugin/pytestplugin.py +++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py @@ -10,6 +10,7 @@ import itertools import operator import os import re +import sys import uuid import pytest @@ -123,9 +124,42 @@ def collect_types_fixture(): collect_types.stop() +def _log_sqlalchemy_info(session): + import sqlalchemy + from sqlalchemy import __version__ + from sqlalchemy.util import has_compiled_ext + from sqlalchemy.util._has_cy import _CYEXTENSION_MSG + + greet = "sqlalchemy installation" + site = "no user site" if sys.flags.no_user_site else "user site loaded" + msgs = [ + f"SQLAlchemy {__version__} ({site})", + f"Path: {sqlalchemy.__file__}", + ] + + if has_compiled_ext(): + from sqlalchemy.cyextension import util + + msgs.append(f"compiled extension enabled, e.g. {util.__file__} ") + else: + msgs.append(f"compiled extension not enabled; {_CYEXTENSION_MSG}") + + pm = session.config.pluginmanager.get_plugin("terminalreporter") + if pm: + pm.write_sep("=", greet) + for m in msgs: + pm.write_line(m) + else: + # fancy pants reporter not found, fallback to plain print + print("=" * 25, greet, "=" * 25) + for m in msgs: + print(m) + + def pytest_sessionstart(session): from sqlalchemy.testing import asyncio + _log_sqlalchemy_info(session) asyncio._assume_async(plugin_base.post_begin) |
