diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-14 21:41:13 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-14 21:41:13 -0400 |
commit | d7498cf4adb8ef9f35d1efa6dc747ac9eb489e60 (patch) | |
tree | de69b7ec88fef69c36704d2a7b06b1a0ffe0f17b /lib/sqlalchemy/testing/plugin/plugin_base.py | |
parent | 7fd3f05805a7cf1ff1fa29ffcf375c4eea6627ba (diff) | |
download | sqlalchemy-d7498cf4adb8ef9f35d1efa6dc747ac9eb489e60.tar.gz |
- 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
Diffstat (limited to 'lib/sqlalchemy/testing/plugin/plugin_base.py')
-rw-r--r-- | lib/sqlalchemy/testing/plugin/plugin_base.py | 56 |
1 files changed, 10 insertions, 46 deletions
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 <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: @@ -234,12 +224,6 @@ def _setup_options(opt, file_config): @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: import 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,20 +257,13 @@ 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): requirement_cls = file_config.get('sqla_testing', "requirement_cls") @@ -369,19 +346,6 @@ def _prep_testing_database(options, file_config): @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: from sqlalchemy.orm.util import randomize_unitofwork |