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/suite | |
| 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/suite')
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_ddl.py | 1 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_insert.py | 6 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_reflection.py | 5 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_results.py | 1 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_select.py | 2 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_sequence.py | 2 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_types.py | 16 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_update_delete.py | 1 |
8 files changed, 33 insertions, 1 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_ddl.py b/lib/sqlalchemy/testing/suite/test_ddl.py index 28251b807..946e10aa8 100644 --- a/lib/sqlalchemy/testing/suite/test_ddl.py +++ b/lib/sqlalchemy/testing/suite/test_ddl.py @@ -8,6 +8,7 @@ from sqlalchemy import Table, Column, Integer, String class TableDDLTest(fixtures.TestBase): + __multiple__ = True def _simple_fixture(self): return Table('test_table', self.metadata, diff --git a/lib/sqlalchemy/testing/suite/test_insert.py b/lib/sqlalchemy/testing/suite/test_insert.py index 5732e37ec..b6fb597dc 100644 --- a/lib/sqlalchemy/testing/suite/test_insert.py +++ b/lib/sqlalchemy/testing/suite/test_insert.py @@ -12,6 +12,8 @@ from ..schema import Table, Column class LastrowidTest(fixtures.TablesTest): run_deletes = 'each' + __multiple__ = True + __requires__ = 'implements_get_lastrowid', 'autoincrement_insert' __engine_options__ = {"implicit_returning": False} @@ -74,6 +76,7 @@ class LastrowidTest(fixtures.TablesTest): class InsertBehaviorTest(fixtures.TablesTest): run_deletes = 'each' + __multiple__ = True @classmethod def define_tables(cls, metadata): @@ -156,8 +159,9 @@ class InsertBehaviorTest(fixtures.TablesTest): ) class ReturningTest(fixtures.TablesTest): - run_deletes = 'each' + run_create_tables = 'each' __requires__ = 'returning', 'autoincrement_insert' + __multiple__ = True __engine_options__ = {"implicit_returning": True} diff --git a/lib/sqlalchemy/testing/suite/test_reflection.py b/lib/sqlalchemy/testing/suite/test_reflection.py index 2b2ba52fe..447691470 100644 --- a/lib/sqlalchemy/testing/suite/test_reflection.py +++ b/lib/sqlalchemy/testing/suite/test_reflection.py @@ -19,6 +19,8 @@ metadata, users = None, None class HasTableTest(fixtures.TablesTest): + __multiple__ = True + @classmethod def define_tables(cls, metadata): Table('test_table', metadata, @@ -33,9 +35,12 @@ class HasTableTest(fixtures.TablesTest): + class ComponentReflectionTest(fixtures.TablesTest): run_inserts = run_deletes = None + __multiple__ = True + @classmethod def define_tables(cls, metadata): cls.define_reflected_tables(metadata, None) diff --git a/lib/sqlalchemy/testing/suite/test_results.py b/lib/sqlalchemy/testing/suite/test_results.py index f81e30e0b..b0265f7b5 100644 --- a/lib/sqlalchemy/testing/suite/test_results.py +++ b/lib/sqlalchemy/testing/suite/test_results.py @@ -10,6 +10,7 @@ from ..schema import Table, Column class RowFetchTest(fixtures.TablesTest): + __multiple__ = True @classmethod def define_tables(cls, metadata): diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py index b8a755b8c..946fc0d8c 100644 --- a/lib/sqlalchemy/testing/suite/test_select.py +++ b/lib/sqlalchemy/testing/suite/test_select.py @@ -15,6 +15,8 @@ class OrderByLabelTest(fixtures.TablesTest): setting. """ + __multiple__ = True + @classmethod def define_tables(cls, metadata): Table("some_table", metadata, diff --git a/lib/sqlalchemy/testing/suite/test_sequence.py b/lib/sqlalchemy/testing/suite/test_sequence.py index 6c6ba5795..9757a295c 100644 --- a/lib/sqlalchemy/testing/suite/test_sequence.py +++ b/lib/sqlalchemy/testing/suite/test_sequence.py @@ -9,6 +9,7 @@ from ..schema import Table, Column class SequenceTest(fixtures.TablesTest): __requires__ = ('sequences',) + __multiple__ = True run_create_tables = 'each' @@ -72,6 +73,7 @@ class SequenceTest(fixtures.TablesTest): class HasSequenceTest(fixtures.TestBase): __requires__ = 'sequences', + __multiple__ = True def test_has_sequence(self): s1 = Sequence('user_id_seq') diff --git a/lib/sqlalchemy/testing/suite/test_types.py b/lib/sqlalchemy/testing/suite/test_types.py index a6e937e8e..f7e0270c8 100644 --- a/lib/sqlalchemy/testing/suite/test_types.py +++ b/lib/sqlalchemy/testing/suite/test_types.py @@ -120,6 +120,7 @@ class _UnicodeFixture(_LiteralRoundTripFixture): class UnicodeVarcharTest(_UnicodeFixture, fixtures.TablesTest): __requires__ = 'unicode_data', + __multiple__ = True datatype = Unicode(255) @@ -130,6 +131,7 @@ class UnicodeVarcharTest(_UnicodeFixture, fixtures.TablesTest): class UnicodeTextTest(_UnicodeFixture, fixtures.TablesTest): __requires__ = 'unicode_data', 'text_type' + __multiple__ = True datatype = UnicodeText() @@ -138,6 +140,8 @@ class UnicodeTextTest(_UnicodeFixture, fixtures.TablesTest): self._test_empty_strings() class TextTest(_LiteralRoundTripFixture, fixtures.TablesTest): + __multiple__ = True + @classmethod def define_tables(cls, metadata): Table('text_table', metadata, @@ -182,6 +186,8 @@ class TextTest(_LiteralRoundTripFixture, fixtures.TablesTest): self._literal_round_trip(Text, [data], [data]) class StringTest(_LiteralRoundTripFixture, fixtures.TestBase): + __multiple__ = True + @requirements.unbounded_varchar def test_nolength_string(self): metadata = MetaData() @@ -258,36 +264,42 @@ class _DateFixture(_LiteralRoundTripFixture): class DateTimeTest(_DateFixture, fixtures.TablesTest): __requires__ = 'datetime', + __multiple__ = True datatype = DateTime data = datetime.datetime(2012, 10, 15, 12, 57, 18) class DateTimeMicrosecondsTest(_DateFixture, fixtures.TablesTest): __requires__ = 'datetime_microseconds', + __multiple__ = True datatype = DateTime data = datetime.datetime(2012, 10, 15, 12, 57, 18, 396) class TimeTest(_DateFixture, fixtures.TablesTest): __requires__ = 'time', + __multiple__ = True datatype = Time data = datetime.time(12, 57, 18) class TimeMicrosecondsTest(_DateFixture, fixtures.TablesTest): __requires__ = 'time_microseconds', + __multiple__ = True datatype = Time data = datetime.time(12, 57, 18, 396) class DateTest(_DateFixture, fixtures.TablesTest): __requires__ = 'date', + __multiple__ = True datatype = Date data = datetime.date(2012, 10, 15) class DateTimeCoercedToDateTimeTest(_DateFixture, fixtures.TablesTest): __requires__ = 'date', + __multiple__ = True datatype = Date data = datetime.datetime(2012, 10, 15, 12, 57, 18) compare = datetime.date(2012, 10, 15) @@ -295,21 +307,25 @@ class DateTimeCoercedToDateTimeTest(_DateFixture, fixtures.TablesTest): class DateTimeHistoricTest(_DateFixture, fixtures.TablesTest): __requires__ = 'datetime_historic', + __multiple__ = True datatype = DateTime data = datetime.datetime(1850, 11, 10, 11, 52, 35) class DateHistoricTest(_DateFixture, fixtures.TablesTest): __requires__ = 'date_historic', + __multiple__ = True datatype = Date data = datetime.date(1727, 4, 1) class IntegerTest(_LiteralRoundTripFixture, fixtures.TestBase): + __multiple__ = True def test_literal(self): self._literal_round_trip(Integer, [5], [5]) class NumericTest(_LiteralRoundTripFixture, fixtures.TestBase): + __multiple__ = True @testing.emits_warning(r".*does \*not\* support Decimal objects natively") @testing.provide_metadata diff --git a/lib/sqlalchemy/testing/suite/test_update_delete.py b/lib/sqlalchemy/testing/suite/test_update_delete.py index a3456ac2a..3cb905615 100644 --- a/lib/sqlalchemy/testing/suite/test_update_delete.py +++ b/lib/sqlalchemy/testing/suite/test_update_delete.py @@ -7,6 +7,7 @@ from ..schema import Table, Column class SimpleUpdateDeleteTest(fixtures.TablesTest): run_deletes = 'each' + __multiple__ = True @classmethod def define_tables(cls, metadata): |
