summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-02-08 16:27:55 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2016-02-08 16:27:55 -0500
commit7cb2a2d6c0cb85f7c51fcd572136589c23aa7a1b (patch)
treed42a350150802183fb83f9b4619b2c58af02b01b
parent0f6d1b7efbed691b23d7bfb17c8738d071671ddc (diff)
downloadsqlalchemy-7cb2a2d6c0cb85f7c51fcd572136589c23aa7a1b.tar.gz
- additional fixes to get oracle + multiprocess to be reliable
-rw-r--r--lib/sqlalchemy/testing/plugin/plugin_base.py7
-rw-r--r--lib/sqlalchemy/testing/plugin/pytestplugin.py4
-rw-r--r--tox.ini2
3 files changed, 12 insertions, 1 deletions
diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py
index 84258df92..22b79d1b3 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 5bb6b966d..0bd79eea0 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 8a4939fd9..83f551fad 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