summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/engines.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-03-03 15:55:17 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-03-03 15:55:17 -0500
commitea05a2321819405020ead5184770d39a0b7948da (patch)
tree1f28366cba2c6c8d4614d0e91a404013137bcd37 /lib/sqlalchemy/testing/engines.py
parentbf89ca2e10ff1c38e76f78e2d11d7858a50df547 (diff)
downloadsqlalchemy-ea05a2321819405020ead5184770d39a0b7948da.tar.gz
- Support has been added for pytest to run tests. This runner
is currently being supported in addition to nose, and will likely be preferred to nose going forward. The nose plugin system used by SQLAlchemy has been split out so that it works under pytest as well. There are no plans to drop support for nose at the moment and we hope that the test suite itself can continue to remain as agnostic of testing platform as possible. See the file README.unittests.rst for updated information on running tests with pytest. The test plugin system has also been enhanced to support running tests against mutiple database URLs at once, by specifying the ``--db`` and/or ``--dburi`` flags multiple times. This does not run the entire test suite for each database, but instead allows test cases that are specific to certain backends make use of that backend as the test is run. When using pytest as the test runner, the system will also run specific test suites multiple times, once for each database, particularly those tests within the "dialect suite". The plan is that the enhanced system will also be used by Alembic, and allow Alembic to run migration operation tests against multiple backends in one run, including third-party backends not included within Alembic itself. Third party dialects and extensions are also encouraged to standardize on SQLAlchemy's test suite as a basis; see the file README.dialects.rst for background on building out from SQLAlchemy's test platform.
Diffstat (limited to 'lib/sqlalchemy/testing/engines.py')
-rw-r--r--lib/sqlalchemy/testing/engines.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/sqlalchemy/testing/engines.py b/lib/sqlalchemy/testing/engines.py
index d85771f8a..d27be3cde 100644
--- a/lib/sqlalchemy/testing/engines.py
+++ b/lib/sqlalchemy/testing/engines.py
@@ -188,7 +188,7 @@ class ReconnectFixture(object):
def reconnecting_engine(url=None, options=None):
- url = url or config.db_url
+ url = url or config.db.url
dbapi = config.db.dialect.dbapi
if not options:
options = {}
@@ -216,7 +216,7 @@ def testing_engine(url=None, options=None):
else:
use_reaper = options.pop('use_reaper', True)
- url = url or config.db_url
+ url = url or config.db.url
if options is None:
options = config.db_opts
@@ -235,22 +235,6 @@ def testing_engine(url=None, options=None):
return engine
-def utf8_engine(url=None, options=None):
- """Hook for dialects or drivers that don't handle utf8 by default."""
-
- from sqlalchemy.engine import url as engine_url
-
- if config.db.dialect.name == 'mysql' and \
- config.db.driver in ['mysqldb', 'pymysql', 'cymysql']:
- # note 1.2.1.gamma.6 or greater of MySQLdb
- # needed here
- url = url or config.db_url
- url = engine_url.make_url(url)
- url.query['charset'] = 'utf8'
- url.query['use_unicode'] = '0'
- url = str(url)
-
- return testing_engine(url, options)
def mock_engine(dialect_name=None):