diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sqlalchemy/testing/plugin/plugin_base.py | 8 | ||||
-rw-r--r-- | lib/sqlalchemy/testing/plugin/pytestplugin.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/testing/suite/test_ddl.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/testing/suite/test_insert.py | 6 | ||||
-rw-r--r-- | lib/sqlalchemy/testing/suite/test_reflection.py | 4 | ||||
-rw-r--r-- | lib/sqlalchemy/testing/suite/test_results.py | 4 | ||||
-rw-r--r-- | lib/sqlalchemy/testing/suite/test_select.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/testing/suite/test_sequence.py | 4 | ||||
-rw-r--r-- | lib/sqlalchemy/testing/suite/test_types.py | 30 | ||||
-rw-r--r-- | lib/sqlalchemy/testing/suite/test_update_delete.py | 2 |
10 files changed, 34 insertions, 30 deletions
diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py index 8bdb7b078..d97546a67 100644 --- a/lib/sqlalchemy/testing/plugin/plugin_base.py +++ b/lib/sqlalchemy/testing/plugin/plugin_base.py @@ -63,6 +63,8 @@ def setup_options(make_option): help="Database uri. Multiple OK, first one is run by default.") make_option("--dropfirst", action="store_true", dest="dropfirst", 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", @@ -309,11 +311,13 @@ def want_class(cls): return False elif cls.__name__.startswith('_'): return False + elif config.options.backend_only and not getattr(cls, '__backend__', False): + return False else: return True def generate_sub_tests(cls, module): - if getattr(cls, '__multiple__', False): + if getattr(cls, '__backend__', False): for cfg in config.Config.all_configs(): name = "%s_%s_%s" % (cls.__name__, cfg.db.name, cfg.db.driver) subcls = type( @@ -321,7 +325,7 @@ def generate_sub_tests(cls, module): (cls, ), { "__only_on__": (cfg.db.name, cfg.db.driver), - "__multiple__": False} + "__backend__": False} ) setattr(module, name, subcls) yield subcls diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py index c51768567..ceb6963ed 100644 --- a/lib/sqlalchemy/testing/plugin/pytestplugin.py +++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py @@ -29,7 +29,7 @@ def pytest_configure(config): def pytest_collection_modifyitems(session, config, items): - # look for all those classes that specify __multiple__ and + # look for all those classes that specify __backend__ and # expand them out into per-database test cases. # this is much easier to do within pytest_pycollect_makeitem, however diff --git a/lib/sqlalchemy/testing/suite/test_ddl.py b/lib/sqlalchemy/testing/suite/test_ddl.py index b14d47b4d..2dca1443d 100644 --- a/lib/sqlalchemy/testing/suite/test_ddl.py +++ b/lib/sqlalchemy/testing/suite/test_ddl.py @@ -8,7 +8,7 @@ from sqlalchemy import Table, Column, Integer, String class TableDDLTest(fixtures.TestBase): - __multiple__ = True + __backend__ = 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 b6fb597dc..3444e15c8 100644 --- a/lib/sqlalchemy/testing/suite/test_insert.py +++ b/lib/sqlalchemy/testing/suite/test_insert.py @@ -12,7 +12,7 @@ from ..schema import Table, Column class LastrowidTest(fixtures.TablesTest): run_deletes = 'each' - __multiple__ = True + __backend__ = True __requires__ = 'implements_get_lastrowid', 'autoincrement_insert' @@ -76,7 +76,7 @@ class LastrowidTest(fixtures.TablesTest): class InsertBehaviorTest(fixtures.TablesTest): run_deletes = 'each' - __multiple__ = True + __backend__ = True @classmethod def define_tables(cls, metadata): @@ -161,7 +161,7 @@ class InsertBehaviorTest(fixtures.TablesTest): class ReturningTest(fixtures.TablesTest): run_create_tables = 'each' __requires__ = 'returning', 'autoincrement_insert' - __multiple__ = True + __backend__ = 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 447691470..762c9955c 100644 --- a/lib/sqlalchemy/testing/suite/test_reflection.py +++ b/lib/sqlalchemy/testing/suite/test_reflection.py @@ -19,7 +19,7 @@ metadata, users = None, None class HasTableTest(fixtures.TablesTest): - __multiple__ = True + __backend__ = True @classmethod def define_tables(cls, metadata): @@ -39,7 +39,7 @@ class HasTableTest(fixtures.TablesTest): class ComponentReflectionTest(fixtures.TablesTest): run_inserts = run_deletes = None - __multiple__ = True + __backend__ = True @classmethod def define_tables(cls, metadata): diff --git a/lib/sqlalchemy/testing/suite/test_results.py b/lib/sqlalchemy/testing/suite/test_results.py index 87d85f6e6..2fdab4d17 100644 --- a/lib/sqlalchemy/testing/suite/test_results.py +++ b/lib/sqlalchemy/testing/suite/test_results.py @@ -10,7 +10,7 @@ from ..schema import Table, Column class RowFetchTest(fixtures.TablesTest): - __multiple__ = True + __backend__ = True @classmethod def define_tables(cls, metadata): @@ -119,7 +119,7 @@ class PercentSchemaNamesTest(fixtures.TablesTest): __requires__ = ('percent_schema_names', ) - __multiple__ = True + __backend__ = 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 946fc0d8c..2ccff61ea 100644 --- a/lib/sqlalchemy/testing/suite/test_select.py +++ b/lib/sqlalchemy/testing/suite/test_select.py @@ -15,7 +15,7 @@ class OrderByLabelTest(fixtures.TablesTest): setting. """ - __multiple__ = True + __backend__ = True @classmethod def define_tables(cls, metadata): diff --git a/lib/sqlalchemy/testing/suite/test_sequence.py b/lib/sqlalchemy/testing/suite/test_sequence.py index 9757a295c..6bc2822fc 100644 --- a/lib/sqlalchemy/testing/suite/test_sequence.py +++ b/lib/sqlalchemy/testing/suite/test_sequence.py @@ -9,7 +9,7 @@ from ..schema import Table, Column class SequenceTest(fixtures.TablesTest): __requires__ = ('sequences',) - __multiple__ = True + __backend__ = True run_create_tables = 'each' @@ -73,7 +73,7 @@ class SequenceTest(fixtures.TablesTest): class HasSequenceTest(fixtures.TestBase): __requires__ = 'sequences', - __multiple__ = True + __backend__ = 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 9f0d9b7aa..811ad1c71 100644 --- a/lib/sqlalchemy/testing/suite/test_types.py +++ b/lib/sqlalchemy/testing/suite/test_types.py @@ -120,7 +120,7 @@ class _UnicodeFixture(_LiteralRoundTripFixture): class UnicodeVarcharTest(_UnicodeFixture, fixtures.TablesTest): __requires__ = 'unicode_data', - __multiple__ = True + __backend__ = True datatype = Unicode(255) @@ -131,7 +131,7 @@ class UnicodeVarcharTest(_UnicodeFixture, fixtures.TablesTest): class UnicodeTextTest(_UnicodeFixture, fixtures.TablesTest): __requires__ = 'unicode_data', 'text_type' - __multiple__ = True + __backend__ = True datatype = UnicodeText() @@ -140,7 +140,7 @@ class UnicodeTextTest(_UnicodeFixture, fixtures.TablesTest): self._test_empty_strings() class TextTest(_LiteralRoundTripFixture, fixtures.TablesTest): - __multiple__ = True + __backend__ = True @classmethod def define_tables(cls, metadata): @@ -186,7 +186,7 @@ class TextTest(_LiteralRoundTripFixture, fixtures.TablesTest): self._literal_round_trip(Text, [data], [data]) class StringTest(_LiteralRoundTripFixture, fixtures.TestBase): - __multiple__ = True + __backend__ = True @requirements.unbounded_varchar def test_nolength_string(self): @@ -264,42 +264,42 @@ class _DateFixture(_LiteralRoundTripFixture): class DateTimeTest(_DateFixture, fixtures.TablesTest): __requires__ = 'datetime', - __multiple__ = True + __backend__ = True datatype = DateTime data = datetime.datetime(2012, 10, 15, 12, 57, 18) class DateTimeMicrosecondsTest(_DateFixture, fixtures.TablesTest): __requires__ = 'datetime_microseconds', - __multiple__ = True + __backend__ = True datatype = DateTime data = datetime.datetime(2012, 10, 15, 12, 57, 18, 396) class TimeTest(_DateFixture, fixtures.TablesTest): __requires__ = 'time', - __multiple__ = True + __backend__ = True datatype = Time data = datetime.time(12, 57, 18) class TimeMicrosecondsTest(_DateFixture, fixtures.TablesTest): __requires__ = 'time_microseconds', - __multiple__ = True + __backend__ = True datatype = Time data = datetime.time(12, 57, 18, 396) class DateTest(_DateFixture, fixtures.TablesTest): __requires__ = 'date', - __multiple__ = True + __backend__ = True datatype = Date data = datetime.date(2012, 10, 15) class DateTimeCoercedToDateTimeTest(_DateFixture, fixtures.TablesTest): __requires__ = 'date', - __multiple__ = True + __backend__ = True datatype = Date data = datetime.datetime(2012, 10, 15, 12, 57, 18) compare = datetime.date(2012, 10, 15) @@ -307,25 +307,25 @@ class DateTimeCoercedToDateTimeTest(_DateFixture, fixtures.TablesTest): class DateTimeHistoricTest(_DateFixture, fixtures.TablesTest): __requires__ = 'datetime_historic', - __multiple__ = True + __backend__ = True datatype = DateTime data = datetime.datetime(1850, 11, 10, 11, 52, 35) class DateHistoricTest(_DateFixture, fixtures.TablesTest): __requires__ = 'date_historic', - __multiple__ = True + __backend__ = True datatype = Date data = datetime.date(1727, 4, 1) class IntegerTest(_LiteralRoundTripFixture, fixtures.TestBase): - __multiple__ = True + __backend__ = True def test_literal(self): self._literal_round_trip(Integer, [5], [5]) class NumericTest(_LiteralRoundTripFixture, fixtures.TestBase): - __multiple__ = True + __backend__ = True @testing.emits_warning(r".*does \*not\* support Decimal objects natively") @testing.provide_metadata @@ -520,7 +520,7 @@ class NumericTest(_LiteralRoundTripFixture, fixtures.TestBase): class BooleanTest(_LiteralRoundTripFixture, fixtures.TablesTest): - __multiple__ = True + __backend__ = True @classmethod def define_tables(cls, metadata): diff --git a/lib/sqlalchemy/testing/suite/test_update_delete.py b/lib/sqlalchemy/testing/suite/test_update_delete.py index 3cb905615..88dc95355 100644 --- a/lib/sqlalchemy/testing/suite/test_update_delete.py +++ b/lib/sqlalchemy/testing/suite/test_update_delete.py @@ -7,7 +7,7 @@ from ..schema import Table, Column class SimpleUpdateDeleteTest(fixtures.TablesTest): run_deletes = 'each' - __multiple__ = True + __backend__ = True @classmethod def define_tables(cls, metadata): |