diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-03-03 15:55:17 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-03-03 15:55:17 -0500 |
commit | ea05a2321819405020ead5184770d39a0b7948da (patch) | |
tree | 1f28366cba2c6c8d4614d0e91a404013137bcd37 /lib/sqlalchemy/testing/requirements.py | |
parent | bf89ca2e10ff1c38e76f78e2d11d7858a50df547 (diff) | |
download | sqlalchemy-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/requirements.py')
-rw-r--r-- | lib/sqlalchemy/testing/requirements.py | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index 77a17c1bd..5dd2435d7 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -14,16 +14,11 @@ to provide specific inclusion/exlusions. """ -from . import exclusions, config +from . import exclusions class Requirements(object): - def __init__(self, config): - self.config = config - - @property - def db(self): - return config.db + pass class SuiteRequirements(Requirements): @@ -158,8 +153,8 @@ class SuiteRequirements(Requirements): INSERT DEFAULT VALUES or equivalent.""" return exclusions.only_if( - lambda: self.config.db.dialect.supports_empty_insert or \ - self.config.db.dialect.supports_default_values, + lambda config: config.db.dialect.supports_empty_insert or \ + config.db.dialect.supports_default_values, "empty inserts not supported" ) @@ -174,7 +169,7 @@ class SuiteRequirements(Requirements): """target platform supports RETURNING.""" return exclusions.only_if( - lambda: self.config.db.dialect.implicit_returning, + lambda config: config.db.dialect.implicit_returning, "'returning' not supported by database" ) @@ -184,7 +179,7 @@ class SuiteRequirements(Requirements): UPPERCASE as case insensitive names.""" return exclusions.skip_if( - lambda: not self.db.dialect.requires_name_normalize, + lambda config: not config.db.dialect.requires_name_normalize, "Backend does not require denormalized names." ) @@ -194,7 +189,7 @@ class SuiteRequirements(Requirements): INSERT statement.""" return exclusions.skip_if( - lambda: not self.db.dialect.supports_multivalues_insert, + lambda config: not config.db.dialect.supports_multivalues_insert, "Backend does not support multirow inserts." ) @@ -245,7 +240,7 @@ class SuiteRequirements(Requirements): """Target database must support SEQUENCEs.""" return exclusions.only_if([ - lambda: self.config.db.dialect.supports_sequences + lambda config: config.db.dialect.supports_sequences ], "no sequence support") @property @@ -254,8 +249,8 @@ class SuiteRequirements(Requirements): as a means of generating new PK values.""" return exclusions.only_if([ - lambda: self.config.db.dialect.supports_sequences and \ - self.config.db.dialect.sequences_optional + lambda config: config.db.dialect.supports_sequences and \ + config.db.dialect.sequences_optional ], "no sequence support, or sequences not optional") @@ -528,8 +523,8 @@ class SuiteRequirements(Requirements): """Catchall for a large variety of MySQL on Windows failures""" return exclusions.open() - def _has_mysql_on_windows(self): + def _has_mysql_on_windows(self, config): return False - def _has_mysql_fully_case_sensitive(self): + def _has_mysql_fully_case_sensitive(self, config): return False |