From d7498cf4adb8ef9f35d1efa6dc747ac9eb489e60 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 14 Sep 2014 21:41:13 -0400 Subject: - remove some crufty old testing options - reestablish the "bootstrap" system of loading the test runners in testing/plugin; using the updated approach we just came up with for alembic. Coverage should be fixed now when running either py.test or nose. fixes #3196 - upgrade tox.ini and start using a .coveragerc file --- lib/sqlalchemy/testing/plugin/plugin_base.py | 56 +++++----------------------- 1 file changed, 10 insertions(+), 46 deletions(-) (limited to 'lib/sqlalchemy/testing/plugin/plugin_base.py') diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py index 7ba31d3e3..6696427dc 100644 --- a/lib/sqlalchemy/testing/plugin/plugin_base.py +++ b/lib/sqlalchemy/testing/plugin/plugin_base.py @@ -31,8 +31,6 @@ if py3k: else: import ConfigParser as configparser -FOLLOWER_IDENT = None - # late imports fixtures = None engines = None @@ -72,8 +70,6 @@ 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("--mockpool", action="store_true", dest="mockpool", - help="Use mock pool (asserts only one connection used)") make_option("--low-connections", action="store_true", dest="low_connections", help="Use a low number of distinct connections - " @@ -95,14 +91,6 @@ def setup_options(make_option): make_option("--exclude-tag", action="callback", callback=_exclude_tag, type="string", help="Exclude tests with tag ") - make_option("--serverside", action="store_true", - help="Turn on server side cursors for PG") - make_option("--mysql-engine", action="store", - dest="mysql_engine", default=None, - help="Use the specified MySQL storage engine for all tables, " - "default is a db-default/InnoDB combo.") - make_option("--tableopts", action="append", dest="tableopts", default=[], - help="Add a dialect-specific table option, key=value") make_option("--write-profiles", action="store_true", dest="write_profiles", default=False, help="Write/update profiling data.") @@ -115,8 +103,8 @@ def configure_follower(follower_ident): database creation. """ - global FOLLOWER_IDENT - FOLLOWER_IDENT = follower_ident + from sqlalchemy.testing import provision + provision.FOLLOWER_IDENT = follower_ident def memoize_important_follower_config(dict_): @@ -177,12 +165,14 @@ def post_begin(): global util, fixtures, engines, exclusions, \ assertions, warnings, profiling,\ config, testing - from sqlalchemy import testing - from sqlalchemy.testing import fixtures, engines, exclusions, \ - assertions, warnings, profiling, config - from sqlalchemy import util + from sqlalchemy import testing # noqa + from sqlalchemy.testing import fixtures, engines, exclusions # noqa + from sqlalchemy.testing import assertions, warnings, profiling # noqa + from sqlalchemy.testing import config # noqa + from sqlalchemy import util # noqa warnings.setup_filters() + def _log(opt_str, value, parser): global logging if not logging: @@ -233,12 +223,6 @@ def _setup_options(opt, file_config): options = opt -@pre -def _server_side_cursors(options, file_config): - if options.serverside: - db_opts['server_side_cursors'] = True - - @pre def _monkeypatch_cdecimal(options, file_config): if options.cdecimal: @@ -250,7 +234,7 @@ def _monkeypatch_cdecimal(options, file_config): def _engine_uri(options, file_config): from sqlalchemy.testing import config from sqlalchemy import testing - from sqlalchemy.testing.plugin import provision + from sqlalchemy.testing import provision if options.dburi: db_urls = list(options.dburi) @@ -273,19 +257,12 @@ def _engine_uri(options, file_config): for db_url in db_urls: cfg = provision.setup_config( - db_url, db_opts, options, file_config, FOLLOWER_IDENT) + db_url, db_opts, options, file_config, provision.FOLLOWER_IDENT) if not config._current: cfg.set_as_current(cfg, testing) -@post -def _engine_pool(options, file_config): - if options.mockpool: - from sqlalchemy import pool - db_opts['poolclass'] = pool.AssertionPool - - @post def _requirements(options, file_config): @@ -368,19 +345,6 @@ def _prep_testing_database(options, file_config): schema=enum['schema']))) -@post -def _set_table_options(options, file_config): - from sqlalchemy.testing import schema - - table_options = schema.table_options - for spec in options.tableopts: - key, value = spec.split('=') - table_options[key] = value - - if options.mysql_engine: - table_options['mysql_engine'] = options.mysql_engine - - @post def _reverse_topological(options, file_config): if options.reversetop: -- cgit v1.2.1