summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/plugin/plugin_base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-08-14 12:04:26 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-08-14 12:41:58 -0400
commit2c594da2148bf15bcb8e10fc9616bbacc70b61a3 (patch)
tree1f49132bc5baa25d665325c4ff3d73ba69da2154 /lib/sqlalchemy/testing/plugin/plugin_base.py
parentbb9d511e52ee5ab3621d8595328ee2400242461a (diff)
downloadsqlalchemy-2c594da2148bf15bcb8e10fc9616bbacc70b61a3.tar.gz
Isolate memory tests in forks
Swing the biggest hammer, run multiprocessing.Process() for each memusage test individually so that they are fully isolated from the parent process and any side effects of pytest-xdist Also add --nomemory as a shortcut to exclude_tags=memory-intensive and add this to the setup.py test runner as the memory tests should not be running for quick runs Change-Id: I3c16c781e21b33deb939a64e77a6e0e41fb86922
Diffstat (limited to 'lib/sqlalchemy/testing/plugin/plugin_base.py')
-rw-r--r--lib/sqlalchemy/testing/plugin/plugin_base.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py
index ab968a379..506a1c922 100644
--- a/lib/sqlalchemy/testing/plugin/plugin_base.py
+++ b/lib/sqlalchemy/testing/plugin/plugin_base.py
@@ -63,6 +63,8 @@ def setup_options(make_option):
help="Drop all tables in the target database first")
make_option("--backend-only", action="store_true", dest="backend_only",
help="Run only tests marked with __backend__")
+ make_option("--nomemory", action="store_true", dest="nomemory",
+ help="Don't run memory profiling tests")
make_option("--low-connections", action="store_true",
dest="low_connections",
help="Use a low number of distinct connections - "
@@ -229,6 +231,12 @@ def _setup_options(opt, file_config):
@pre
+def _set_nomemory(opt, file_config):
+ if opt.nomemory:
+ exclude_tags.add("memory_intensive")
+
+
+@pre
def _monkeypatch_cdecimal(options, file_config):
if options.cdecimal:
import cdecimal