From: Mike Bayer Date: Mon, 8 Feb 2016 21:27:55 +0000 (-0500) Subject: - additional fixes to get oracle + multiprocess to be reliable X-Git-Tag: rel_1_1_0b1~98^2~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cb2a2d6c0cb85f7c51fcd572136589c23aa7a1b;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - additional fixes to get oracle + multiprocess to be reliable --- diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py index 84258df922..22b79d1b32 100644 --- a/lib/sqlalchemy/testing/plugin/plugin_base.py +++ b/lib/sqlalchemy/testing/plugin/plugin_base.py @@ -174,6 +174,7 @@ def post_begin(): warnings.setup_filters() + def _log(opt_str, value, parser): global logging if not logging: @@ -436,6 +437,12 @@ def _restore_engine(): config._current.reset(testing) +def final_process_cleanup(): + engines.testing_reaper._stop_test_ctx_aggressive() + assertions.global_cleanup_assertions() + _restore_engine() + + def _setup_engine(cls): if getattr(cls, '__engine_options__', None): eng = engines.testing_engine(options=cls.__engine_options__) diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py index 5bb6b966d5..0bd79eea04 100644 --- a/lib/sqlalchemy/testing/plugin/pytestplugin.py +++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py @@ -54,6 +54,10 @@ def pytest_configure(config): def pytest_sessionstart(session): plugin_base.post_begin() + +def pytest_sessionfinish(session): + plugin_base.final_process_cleanup() + if has_xdist: import uuid diff --git a/tox.ini b/tox.ini index 8a4939fd93..83f551fadf 100644 --- a/tox.ini +++ b/tox.ini @@ -47,7 +47,7 @@ setenv= sqlite: SQLITE=--db sqlite postgresql: POSTGRESQL=--db postgresql mysql: MYSQL=--db mysql --db pymysql - oracle: ORACLE=--db oracle + oracle: ORACLE=--db oracle --low-connections mssql: MSSQL=--db pyodbc --db pymssql backendonly: BACKENDONLY=--backend-only