[Sqlalchemy-commits] sqlalchemy: indent the string here
Brought to you by:
zzzeek
From: <co...@sq...> - 2011-03-27 17:17:53
|
details: http://hg.sqlalchemy.org/sqlalchemy/sqlalchemy/rev/99c6aadfb1a2 changeset: 7465:99c6aadfb1a2 user: zzzeek date: Sat Mar 26 15:31:15 2011 -0400 description: indent the string here Subject: sqlalchemy: - remove @testing.resolve_artifact_names, replace with direct attribute details: http://hg.sqlalchemy.org/sqlalchemy/sqlalchemy/rev/4535b1ee63f7 changeset: 7466:4535b1ee63f7 user: zzzeek date: Sat Mar 26 19:03:11 2011 -0400 description: - remove @testing.resolve_artifact_names, replace with direct attribute access to the cls/self.tables/classes registries - express orm/_base.py ORMTest in terms of engine/_base.py TablesTest, factor out common steps into TablesTest, remove AltEngineTest as a separate class. will further consolidate these base classes Subject: sqlalchemy: - move _fixtures into the traditional FixtureTest form. will adjust details: http://hg.sqlalchemy.org/sqlalchemy/sqlalchemy/rev/61258521b56a changeset: 7467:61258521b56a user: zzzeek date: Sat Mar 26 19:30:40 2011 -0400 description: - move _fixtures into the traditional FixtureTest form. will adjust old style tests Subject: sqlalchemy: - move _fixtures to work via the normal methods of _base.MappedTest, convert details: http://hg.sqlalchemy.org/sqlalchemy/sqlalchemy/rev/48d7799bb893 changeset: 7468:48d7799bb893 user: zzzeek date: Sat Mar 26 20:44:47 2011 -0400 description: - move _fixtures to work via the normal methods of _base.MappedTest, convert all referncing tests to not use globals - tests that deal with pickle specifically load the fixture classes from test.lib.pickleable, which gets some more classes added - removed weird sa05 pickling tests that don't matter Subject: sqlalchemy: - convert @provide_metadata to use self access details: http://hg.sqlalchemy.org/sqlalchemy/sqlalchemy/rev/e277589aa2c6 changeset: 7469:e277589aa2c6 user: zzzeek date: Sat Mar 26 21:40:05 2011 -0400 description: - convert @provide_metadata to use self access - having occasional issues with BasicEntity grabbing, if it persists may have to pass an explicit base class into setup_classes()/setup_mappers() Subject: sqlalchemy: fixes for savepoint test details: http://hg.sqlalchemy.org/sqlalchemy/sqlalchemy/rev/0384d4b71e4f changeset: 7470:0384d4b71e4f user: zzzeek date: Sat Mar 26 21:52:31 2011 -0400 description: fixes for savepoint test diffstat: test/aaa_profiling/test_orm.py | 30 +- test/dialect/test_firebird.py | 3 + test/dialect/test_mssql.py | 5 + test/dialect/test_oracle.py | 4 + test/dialect/test_postgresql.py | 15 +- test/dialect/test_sqlite.py | 2 + test/engine/_base.py | 109 +++-- test/engine/test_execute.py | 1 + test/engine/test_reflection.py | 3 + test/ext/test_associationproxy.py | 70 ++- test/ext/test_mutable.py | 11 +- test/lib/engines.py | 6 +- test/lib/pickleable.py | 31 +- test/lib/testing.py | 52 +-- test/orm/_base.py | 122 +---- test/orm/_fixtures.py | 470 +++++++++++----------- test/orm/inheritance/test_abc_polymorphic.py | 2 +- test/orm/inheritance/test_basic.py | 125 ++++- test/orm/inheritance/test_concrete.py | 47 ++- test/orm/inheritance/test_polymorph.py | 4 +- test/orm/inheritance/test_polymorph2.py | 8 +- test/orm/inheritance/test_query.py | 108 +++- test/orm/inheritance/test_selects.py | 4 +- test/orm/inheritance/test_single.py | 72 +++- test/orm/test_association.py | 26 +- test/orm/test_assorted_eager.py | 125 +++++- test/orm/test_backref_mutations.py | 91 +++- test/orm/test_bind.py | 9 +- test/orm/test_cascade.py | 540 ++++++++++++++++++++------ test/orm/test_collection.py | 37 +- test/orm/test_composites.py | 108 +++- test/orm/test_cycles.py | 126 +++++- test/orm/test_defaults.py | 12 +- test/orm/test_deprecations.py | 78 ++- test/orm/test_dynamic.py | 146 ++++++- test/orm/test_eager_relations.py | 376 +++++++++++++++-- test/orm/test_evaluator.py | 15 +- test/orm/test_events.py | 129 ++++- test/orm/test_expire.py | 200 +++++++-- test/orm/test_froms.py | 261 +++++++++--- test/orm/test_generative.py | 100 +++- test/orm/test_immediate_load.py | 12 +- test/orm/test_joins.py | 230 +++++++++-- test/orm/test_lazy_relations.py | 124 +++++- test/orm/test_legacy_mutable.py | 42 +- test/orm/test_manytomany.py | 75 +++- test/orm/test_mapper.py | 506 +++++++++++++++++++----- test/orm/test_merge.py | 154 ++++++- test/orm/test_naturalpks.py | 116 ++++- test/orm/test_onetoone.py | 7 +- test/orm/test_pickled.py | 224 +++++++--- test/orm/test_query.py | 419 ++++++++++++++++++-- test/orm/test_relationships.py | 436 +++++++++++++++++---- test/orm/test_scoping.py | 3 +- test/orm/test_selectable.py | 12 +- test/orm/test_session.py | 294 +++++++++----- test/orm/test_subquery_relations.py | 184 +++++++- test/orm/test_transaction.py | 44 ++- test/orm/test_unitofwork.py | 342 +++++++++++++--- test/orm/test_unitofworkv2.py | 119 +++++- test/orm/test_utils.py | 9 +- test/orm/test_versioning.py | 84 +++- test/perf/sessions.py | 4 +- test/sql/test_defaults.py | 20 +- test/sql/test_metadata.py | 1 + test/sql/test_types.py | 23 +- 66 files changed, 5328 insertions(+), 1839 deletions(-) diffs (truncated from 18644 to 300 lines): diff -r 7934e402c8c0 -r 0384d4b71e4f test/aaa_profiling/test_orm.py --- a/test/aaa_profiling/test_orm.py Sat Mar 26 11:53:07 2011 -0400 +++ b/test/aaa_profiling/test_orm.py Sat Mar 26 21:52:31 2011 -0400 @@ -30,21 +30,27 @@ pass @classmethod - @testing.resolve_artifact_names def setup_mappers(cls): + Child, Parent, parent, child = (cls.classes.Child, + cls.classes.Parent, + cls.tables.parent, + cls.tables.child) + mapper(Parent, parent, properties={'children' : relationship(Child, backref='parent')}) mapper(Child, child) @classmethod - @testing.resolve_artifact_names def insert_data(cls): + parent, child = cls.tables.parent, cls.tables.child + parent.insert().execute({'id': 1, 'data': 'p1'}) child.insert().execute({'id': 1, 'data': 'p1c1', 'parent_id' : 1}) - @testing.resolve_artifact_names def test_merge_no_load(self): + Parent = self.classes.Parent + sess = sessionmaker()() sess2 = sessionmaker()() p1 = sess.query(Parent).get(1) @@ -68,8 +74,9 @@ p3 = go() @testing.only_on('sqlite', 'Call counts tailored to pysqlite') - @testing.resolve_artifact_names def test_merge_load(self): + Parent = self.classes.Parent + sess = sessionmaker()() sess2 = sessionmaker()() p1 = sess.query(Parent).get(1) @@ -133,15 +140,20 @@ pass @classmethod - @testing.resolve_artifact_names def setup_mappers(cls): + Child, Parent, parent, child = (cls.classes.Child, + cls.classes.Parent, + cls.tables.parent, + cls.tables.child) + mapper(Parent, parent, properties={ 'child': relationship(Child)}) mapper(Child, child) @classmethod - @testing.resolve_artifact_names def insert_data(cls): + parent, child = cls.tables.parent, cls.tables.child + child.insert().execute([ {'id':i, 'data':'c%d' % i} for i in xrange(1, 251) @@ -155,8 +167,9 @@ for i in xrange(1, 1000) ]) - @testing.resolve_artifact_names def test_many_to_one_load_no_identity(self): + Parent = self.classes.Parent + sess = Session() parents = sess.query(Parent).all() @@ -167,8 +180,9 @@ p.child go() - @testing.resolve_artifact_names def test_many_to_one_load_identity(self): + Parent, Child = self.classes.Parent, self.classes.Child + sess = Session() parents = sess.query(Parent).all() children = sess.query(Child).all() diff -r 7934e402c8c0 -r 0384d4b71e4f test/dialect/test_firebird.py --- a/test/dialect/test_firebird.py Sat Mar 26 11:53:07 2011 -0400 +++ b/test/dialect/test_firebird.py Sat Mar 26 21:52:31 2011 -0400 @@ -324,6 +324,7 @@ @testing.provide_metadata def test_infinite_float(self): + metadata = self.metadata t = Table('t', metadata, Column('data', Float) ) @@ -339,6 +340,7 @@ @testing.provide_metadata def test_strlen(self): + metadata = self.metadata # On FB the length() function is implemented by an external UDF, # strlen(). Various SA tests fail because they pass a parameter @@ -370,6 +372,7 @@ @testing.provide_metadata def test_rowcount_flag(self): + metadata = self.metadata engine = engines.testing_engine(options={'enable_rowcount' : True}) assert engine.dialect.supports_sane_rowcount diff -r 7934e402c8c0 -r 0384d4b71e4f test/dialect/test_mssql.py --- a/test/dialect/test_mssql.py Sat Mar 26 11:53:07 2011 -0400 +++ b/test/dialect/test_mssql.py Sat Mar 26 21:52:31 2011 -0400 @@ -485,6 +485,7 @@ @testing.provide_metadata def test_identity(self): + metadata = self.metadata table = Table( 'identity_test', metadata, Column('col1', Integer, Sequence('fred', 2, 3), primary_key=True) @@ -501,6 +502,7 @@ @testing.emits_warning("Did not recognize") @testing.provide_metadata def test_skip_types(self): + metadata = self.metadata testing.db.execute(""" create table foo (id integer primary key, data xml) """) @@ -510,6 +512,7 @@ @testing.provide_metadata def test_indexes_cols(self): + metadata = self.metadata t1 = Table('t', metadata, Column('x', Integer), Column('y', Integer)) Index('foo', t1.c.x, t1.c.y) @@ -525,6 +528,7 @@ @testing.provide_metadata def test_indexes_cols_with_commas(self): + metadata = self.metadata t1 = Table('t', metadata, Column('x, col', Integer, key='x'), @@ -543,6 +547,7 @@ @testing.provide_metadata def test_indexes_cols_with_spaces(self): + metadata = self.metadata t1 = Table('t', metadata, Column('x col', Integer, key='x'), Column('y', Integer)) diff -r 7934e402c8c0 -r 0384d4b71e4f test/dialect/test_oracle.py --- a/test/dialect/test_oracle.py Sat Mar 26 11:53:07 2011 -0400 +++ b/test/dialect/test_oracle.py Sat Mar 26 21:52:31 2011 -0400 @@ -702,6 +702,7 @@ @testing.provide_metadata def test_rowid(self): + metadata = self.metadata t = Table('t1', metadata, Column('x', Integer) ) @@ -804,6 +805,7 @@ @testing.provide_metadata def test_numerics_broken_inspection(self): + metadata = self.metadata """Numeric scenarios where Oracle type info is 'broken', returning us precision, scale of the form (0, 0) or (0, -127). We convert to Decimal and let int()/float() processors take over. @@ -1076,6 +1078,7 @@ @testing.provide_metadata def test_output_type_handler(self): + metadata = self.metadata for stmt, exp, kw in [ ("SELECT 0.1 FROM DUAL", decimal.Decimal("0.1"), {}), ("SELECT 15 FROM DUAL", 15, {}), @@ -1285,6 +1288,7 @@ @testing.provide_metadata def test_limit_offset_for_update(self): + metadata = self.metadata # oracle can't actually do the ROWNUM thing with FOR UPDATE # very well. diff -r 7934e402c8c0 -r 0384d4b71e4f test/dialect/test_postgresql.py --- a/test/dialect/test_postgresql.py Sat Mar 26 11:53:07 2011 -0400 +++ b/test/dialect/test_postgresql.py Sat Mar 26 21:52:31 2011 -0400 @@ -32,6 +32,7 @@ @testing.only_on('postgresql', 'foo') @testing.provide_metadata def test_reverse_eng_name(self): + metadata = self.metadata engine = engines.testing_engine(options=dict(implicit_returning=False)) for tname, cname in [ ('tb1' * 30, 'abc'), @@ -242,8 +243,9 @@ ) @classmethod - @testing.resolve_artifact_names def insert_data(cls): + data_table = cls.tables.data_table + data_table.insert().execute( {'data':3}, {'data':5}, @@ -257,8 +259,9 @@ {'data':9}, ) - @testing.resolve_artifact_names def test_float_coercion(self): + data_table = self.tables.data_table + for type_, result in [ (Numeric, decimal.Decimal('140.381230939')), (Float, 140.381230939), @@ -282,6 +285,7 @@ @testing.provide_metadata def test_arrays(self): + metadata = self.metadata t1 = Table('t', metadata, Column('x', postgresql.ARRAY(Float)), Column('y', postgresql.ARRAY(postgresql.REAL)), @@ -523,6 +527,7 @@ @testing.provide_metadata def test_numeric_default(self): + metadata = self.metadata # pg8000 appears to fail when the value is 0, # returns an int instead of decimal. t =Table('t', metadata, @@ -1205,6 +1210,7 @@ @testing.provide_metadata def test_date_reflection(self): + metadata = self.metadata t1 = Table('pgdate', metadata, Column('date1', DateTime(timezone=True)), Column('date2', DateTime(timezone=False))) @@ -1307,6 +1313,7 @@ @testing.provide_metadata def test_renamed_sequence_reflection(self): + metadata = self.metadata t = Table('t', metadata, Column('id', Integer, primary_key=True)) metadata.create_all() m2 = MetaData(testing.db) @@ -1452,6 +1459,7 @@ @testing.provide_metadata def test_index_reflection(self): + metadata = self.metadata """ Reflecting partial & expression-based indexes should warn """ @@ -1619,6 +1627,7 @@ @testing.only_on('postgresql', 'DB specific feature') @testing.provide_metadata def test_reflection(self): + metadata = self.metadata t1 = Table( 't1', metadata, @@ -1776,6 +1785,7 @@ @testing.provide_metadata def test_tuple_flag(self): + metadata = self.metadata assert_raises_message( exc.ArgumentError, "mutable must be set to False if as_tuple is True.", @@ -2029,6 +2039,7 @@ @testing.provide_metadata def test_bit_reflection(self): + metadata = self.metadata t1 = Table('t1', metadata, Column('bit1', postgresql.BIT()), Column('bit5', postgresql.BIT(5)), diff -r 7934e402c8c0 -r 0384d4b71e4f test/dialect/test_sqlite.py --- a/test/dialect/test_sqlite.py Sat Mar 26 11:53:07 2011 -0400 +++ b/test/dialect/test_sqlite.py Sat Mar 26 21:52:31 2011 -0400 @@ -101,6 +101,7 @@ @testing.provide_metadata def test_type_reflection(self): + metadata = self.metadata |