diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-07-28 17:05:50 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-07-28 17:05:50 -0400 |
| commit | 22ba1c43b792953ae6f791512d276739c8c09eae (patch) | |
| tree | bdf9f639b01426a8a2e1c8c61d35533026dd4265 /test/sql | |
| parent | 27913554a85c308d81e6c018669d0246ceecc639 (diff) | |
| download | sqlalchemy-22ba1c43b792953ae6f791512d276739c8c09eae.tar.gz | |
-whitespace bonanza, contd
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/test_constraints.py | 26 | ||||
| -rw-r--r-- | test/sql/test_defaults.py | 52 | ||||
| -rw-r--r-- | test/sql/test_functions.py | 14 | ||||
| -rw-r--r-- | test/sql/test_generative.py | 64 | ||||
| -rw-r--r-- | test/sql/test_labels.py | 58 | ||||
| -rw-r--r-- | test/sql/test_metadata.py | 104 | ||||
| -rw-r--r-- | test/sql/test_query.py | 48 | ||||
| -rw-r--r-- | test/sql/test_quote.py | 14 | ||||
| -rw-r--r-- | test/sql/test_rowcount.py | 4 | ||||
| -rw-r--r-- | test/sql/test_types.py | 112 | ||||
| -rw-r--r-- | test/sql/test_unicode.py | 2 | ||||
| -rw-r--r-- | test/sql/test_update.py | 26 |
12 files changed, 262 insertions, 262 deletions
diff --git a/test/sql/test_constraints.py b/test/sql/test_constraints.py index fcc6c085e..2869839dc 100644 --- a/test/sql/test_constraints.py +++ b/test/sql/test_constraints.py @@ -194,7 +194,7 @@ class ConstraintTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled ('sometable', 'this_name_alsois_long', 'ix_sometable_t_3cf1'), ]: - t1 = Table(tname, MetaData(), + t1 = Table(tname, MetaData(), Column(cname, Integer, index=True), ) ix1 = list(t1.indexes)[0] @@ -213,24 +213,24 @@ class ConstraintTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled assert_raises( exc.IdentifierError, schema.CreateIndex(Index( - "this_other_name_is_too_long_for_what_were_doing", + "this_other_name_is_too_long_for_what_were_doing", t1.c.c)).compile, dialect=dialect ) def test_index_declartion_inline(self): - t1 = Table('t1', metadata, + t1 = Table('t1', metadata, Column('x', Integer), Column('y', Integer), Index('foo', 'x', 'y') ) self.assert_compile( - schema.CreateIndex(list(t1.indexes)[0]), + schema.CreateIndex(list(t1.indexes)[0]), "CREATE INDEX foo ON t1 (x, y)" ) def test_index_asserts_cols_standalone(self): - t1 = Table('t1', metadata, + t1 = Table('t1', metadata, Column('x', Integer) ) t2 = Table('t2', metadata, @@ -244,7 +244,7 @@ class ConstraintTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled ) def test_index_asserts_cols_inline(self): - t1 = Table('t1', metadata, + t1 = Table('t1', metadata, Column('x', Integer) ) assert_raises_message( @@ -384,7 +384,7 @@ class ConstraintCompilationTest(fixtures.TestBase, AssertsCompiledSQL): def test_multiple(self): m = MetaData() - foo = Table("foo", m, + foo = Table("foo", m, Column('id', Integer, primary_key=True), Column('bar', Integer, primary_key=True) ) @@ -433,11 +433,11 @@ class ConstraintCompilationTest(fixtures.TestBase, AssertsCompiledSQL): m.drop_all(e) e.assert_sql([ - 'CREATE TABLE t (a INTEGER)', - 'CREATE TABLE t2 (a INTEGER, b INTEGER, CONSTRAINT fk_tb FOREIGN KEY(b) REFERENCES t (a))', - 'ALTER TABLE t2 ADD CONSTRAINT fk_ta FOREIGN KEY(a) REFERENCES t (a)', - 'ALTER TABLE t2 DROP CONSTRAINT fk_ta', - 'DROP TABLE t2', + 'CREATE TABLE t (a INTEGER)', + 'CREATE TABLE t2 (a INTEGER, b INTEGER, CONSTRAINT fk_tb FOREIGN KEY(b) REFERENCES t (a))', + 'ALTER TABLE t2 ADD CONSTRAINT fk_ta FOREIGN KEY(a) REFERENCES t (a)', + 'ALTER TABLE t2 DROP CONSTRAINT fk_ta', + 'DROP TABLE t2', 'DROP TABLE t' ]) @@ -456,7 +456,7 @@ class ConstraintCompilationTest(fixtures.TestBase, AssertsCompiledSQL): ) constraint = CheckConstraint('a < b',name="my_test_constraint", - deferrable=True,initially='DEFERRED', + deferrable=True,initially='DEFERRED', table=t) diff --git a/test/sql/test_defaults.py b/test/sql/test_defaults.py index ec08cd28e..7a6c6d009 100644 --- a/test/sql/test_defaults.py +++ b/test/sql/test_defaults.py @@ -305,7 +305,7 @@ class DefaultTest(fixtures.TestBase): def test_no_embed_in_sql(self): """Using a DefaultGenerator, Sequence, DefaultClause - in the columns, where clause of a select, or in the values + in the columns, where clause of a select, or in the values clause of insert, update, raises an informative error""" for const in ( @@ -330,7 +330,7 @@ class DefaultTest(fixtures.TestBase): ) def test_missing_many_param(self): - assert_raises_message(exc.StatementError, + assert_raises_message(exc.StatementError, "A value is required for bind parameter 'col7', in parameter group 1", t.insert().execute, {'col4':7, 'col7':12, 'col8':19}, @@ -558,8 +558,8 @@ class AutoIncrementTest(fixtures.TablesTest): Column('id', Integer(), primary_key=True) ) x = Table('x', m, - Column('id', Integer(), - ForeignKey('y.id'), + Column('id', Integer(), + ForeignKey('y.id'), autoincrement="ignore_fk", primary_key=True) ) assert x._autoincrement_column is x.c.id @@ -570,8 +570,8 @@ class AutoIncrementTest(fixtures.TablesTest): Column('id', Integer(), primary_key=True) ) x = Table('x', m, - Column('id', Integer(), - ForeignKey('y.id'), + Column('id', Integer(), + ForeignKey('y.id'), primary_key=True) ) assert x._autoincrement_column is None @@ -652,7 +652,7 @@ class SequenceExecTest(fixtures.TestBase): self._assert_seq_result(s.execute(testing.db)) def test_explicit_optional(self): - """test dialect executes a Sequence, returns nextval, whether + """test dialect executes a Sequence, returns nextval, whether or not "optional" is set """ s = Sequence("my_sequence", optional=True) @@ -721,7 +721,7 @@ class SequenceExecTest(fixtures.TestBase): @testing.provide_metadata def test_inserted_pk_no_returning(self): - """test inserted_primary_key contains [None] when + """test inserted_primary_key contains [None] when pk_col=next_value(), implicit returning is not used.""" metadata = self.metadata @@ -740,7 +740,7 @@ class SequenceExecTest(fixtures.TestBase): @testing.requires.returning @testing.provide_metadata def test_inserted_pk_implicit_returning(self): - """test inserted_primary_key contains the result when + """test inserted_primary_key contains the result when pk_col=next_value(), when implicit returning is used.""" metadata = self.metadata @@ -762,8 +762,8 @@ class SequenceTest(fixtures.TestBase, testing.AssertsCompiledSQL): @testing.fails_on('firebird', 'no FB support for start/increment') def test_start_increment(self): for seq in ( - Sequence('foo_seq'), - Sequence('foo_seq', start=8), + Sequence('foo_seq'), + Sequence('foo_seq', start=8), Sequence('foo_seq', increment=5)): seq.create(testing.db) try: @@ -782,11 +782,11 @@ class SequenceTest(fixtures.TestBase, testing.AssertsCompiledSQL): return testing.db.dialect.has_sequence(testing.db, name) def test_nextval_render(self): - """test dialect renders the "nextval" construct, + """test dialect renders the "nextval" construct, whether or not "optional" is set """ for s in ( - Sequence("my_seq"), + Sequence("my_seq"), Sequence("my_seq", optional=True)): assert str(s.next_value(). compile(dialect=testing.db.dialect)) in ( @@ -796,7 +796,7 @@ class SequenceTest(fixtures.TestBase, testing.AssertsCompiledSQL): ) def test_nextval_unsupported(self): - """test next_value() used on non-sequence platform + """test next_value() used on non-sequence platform raises NotImplementedError.""" s = Sequence("my_seq") @@ -844,7 +844,7 @@ class SequenceTest(fixtures.TestBase, testing.AssertsCompiledSQL): s1 = Sequence("s1", metadata=metadata) s2 = Sequence("s2", metadata=metadata) s3 = Sequence("s3") - t = Table('t', metadata, + t = Table('t', metadata, Column('c', Integer, s3, primary_key=True)) assert s3.metadata is metadata @@ -1017,7 +1017,7 @@ class SpecialTypePKTest(fixtures.TestBase): class ServerDefaultsOnPKTest(fixtures.TestBase): @testing.provide_metadata def test_string_default_none_on_insert(self): - """Test that without implicit returning, we return None for + """Test that without implicit returning, we return None for a string server default. That is, we don't want to attempt to pre-execute "server_default" @@ -1027,7 +1027,7 @@ class ServerDefaultsOnPKTest(fixtures.TestBase): """ metadata = self.metadata - t = Table('x', metadata, + t = Table('x', metadata, Column('y', String(10), server_default='key_one', primary_key=True), Column('data', String(10)), implicit_returning=False @@ -1046,7 +1046,7 @@ class ServerDefaultsOnPKTest(fixtures.TestBase): """With implicit_returning, we get a string PK default back no problem.""" metadata = self.metadata - t = Table('x', metadata, + t = Table('x', metadata, Column('y', String(10), server_default='key_one', primary_key=True), Column('data', String(10)) ) @@ -1061,8 +1061,8 @@ class ServerDefaultsOnPKTest(fixtures.TestBase): @testing.provide_metadata def test_int_default_none_on_insert(self): metadata = self.metadata - t = Table('x', metadata, - Column('y', Integer, + t = Table('x', metadata, + Column('y', Integer, server_default='5', primary_key=True), Column('data', String(10)), implicit_returning=False @@ -1084,8 +1084,8 @@ class ServerDefaultsOnPKTest(fixtures.TestBase): @testing.provide_metadata def test_autoincrement_reflected_from_server_default(self): metadata = self.metadata - t = Table('x', metadata, - Column('y', Integer, + t = Table('x', metadata, + Column('y', Integer, server_default='5', primary_key=True), Column('data', String(10)), implicit_returning=False @@ -1100,8 +1100,8 @@ class ServerDefaultsOnPKTest(fixtures.TestBase): @testing.provide_metadata def test_int_default_none_on_insert_reflected(self): metadata = self.metadata - t = Table('x', metadata, - Column('y', Integer, + t = Table('x', metadata, + Column('y', Integer, server_default='5', primary_key=True), Column('data', String(10)), implicit_returning=False @@ -1128,8 +1128,8 @@ class ServerDefaultsOnPKTest(fixtures.TestBase): @testing.provide_metadata def test_int_default_on_insert_with_returning(self): metadata = self.metadata - t = Table('x', metadata, - Column('y', Integer, + t = Table('x', metadata, + Column('y', Integer, server_default='5', primary_key=True), Column('data', String(10)) ) diff --git a/test/sql/test_functions.py b/test/sql/test_functions.py index 961845bac..2f9c6f908 100644 --- a/test/sql/test_functions.py +++ b/test/sql/test_functions.py @@ -36,13 +36,13 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): GenericFunction.__init__(self, args=[arg], **kwargs) self.assert_compile( - fake_func('foo'), - "fake_func(%s)" % - bindtemplate % {'name':'param_1', 'position':1}, + fake_func('foo'), + "fake_func(%s)" % + bindtemplate % {'name':'param_1', 'position':1}, dialect=dialect) def test_use_labels(self): - self.assert_compile(select([func.foo()], use_labels=True), + self.assert_compile(select([func.foo()], use_labels=True), "SELECT foo() AS foo_1" ) def test_underscores(self): @@ -105,12 +105,12 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): for fn in [func.coalesce, func.max, func.min, func.sum]: for args, type_ in [ - ((datetime.date(2007, 10, 5), + ((datetime.date(2007, 10, 5), datetime.date(2005, 10, 15)), sqltypes.Date), ((3, 5), sqltypes.Integer), ((decimal.Decimal(3), decimal.Decimal(5)), sqltypes.Numeric), (("foo", "bar"), sqltypes.String), - ((datetime.datetime(2007, 10, 5, 8, 3, 34), + ((datetime.datetime(2007, 10, 5, 8, 3, 34), datetime.datetime(2005, 10, 15, 14, 45, 33)), sqltypes.DateTime) ]: assert isinstance(fn(*args).type, type_), "%s / %s" % (fn(), type_) @@ -149,7 +149,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): self.assert_compile(func.lala.hoho(7), "lala.hoho(:hoho_1)") # test None becomes NULL - self.assert_compile(func.my_func(1,2,None,3), + self.assert_compile(func.my_func(1,2,None,3), "my_func(:my_func_1, :my_func_2, NULL, :my_func_3)") # test pickling diff --git a/test/sql/test_generative.py b/test/sql/test_generative.py index 29b7cd482..b78559960 100644 --- a/test/sql/test_generative.py +++ b/test/sql/test_generative.py @@ -8,7 +8,7 @@ from sqlalchemy.sql import util as sql_util from test.lib.testing import eq_, ne_, assert_raises class TraversalTest(fixtures.TestBase, AssertsExecutionResults): - """test ClauseVisitor's traversal, particularly its + """test ClauseVisitor's traversal, particularly its ability to copy and modify a ClauseElement in place.""" @classmethod @@ -16,7 +16,7 @@ class TraversalTest(fixtures.TestBase, AssertsExecutionResults): global A, B # establish two ficticious ClauseElements. - # define deep equality semantics as well as deep + # define deep equality semantics as well as deep # identity semantics. class A(ClauseElement): __visit_name__ = 'a' @@ -79,7 +79,7 @@ class TraversalTest(fixtures.TestBase, AssertsExecutionResults): a1 = A("expr1") struct = B(a1, A("expr2"), B(A("expr1b"), A("expr2b")), A("expr3")) struct2 = B(a1, A("expr2"), B(A("expr1b"), A("expr2b")), A("expr3")) - struct3 = B(a1, A("expr2"), B(A("expr1b"), + struct3 = B(a1, A("expr2"), B(A("expr1b"), A("expr2bmodified")), A("expr3")) assert a1.is_other(a1) @@ -90,7 +90,7 @@ class TraversalTest(fixtures.TestBase, AssertsExecutionResults): assert not struct.is_other(struct3) def test_clone(self): - struct = B(A("expr1"), A("expr2"), B(A("expr1b"), + struct = B(A("expr1"), A("expr2"), B(A("expr1b"), A("expr2b")), A("expr3")) class Vis(CloningVisitor): @@ -105,7 +105,7 @@ class TraversalTest(fixtures.TestBase, AssertsExecutionResults): assert not struct.is_other(s2) def test_no_clone(self): - struct = B(A("expr1"), A("expr2"), B(A("expr1b"), + struct = B(A("expr1"), A("expr2"), B(A("expr1b"), A("expr2b")), A("expr3")) class Vis(ClauseVisitor): @@ -120,11 +120,11 @@ class TraversalTest(fixtures.TestBase, AssertsExecutionResults): assert struct.is_other(s2) def test_change_in_place(self): - struct = B(A("expr1"), A("expr2"), B(A("expr1b"), + struct = B(A("expr1"), A("expr2"), B(A("expr1b"), A("expr2b")), A("expr3")) - struct2 = B(A("expr1"), A("expr2modified"), B(A("expr1b"), + struct2 = B(A("expr1"), A("expr2modified"), B(A("expr1b"), A("expr2b")), A("expr3")) - struct3 = B(A("expr1"), A("expr2"), B(A("expr1b"), + struct3 = B(A("expr1"), A("expr2"), B(A("expr1b"), A("expr2bmodified")), A("expr3")) class Vis(CloningVisitor): @@ -280,7 +280,7 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): column("col2"), column("col3"), ) - t3 = Table('table3', MetaData(), + t3 = Table('table3', MetaData(), Column('col1', Integer), Column('col2', Integer) ) @@ -294,7 +294,7 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): f = t.c.col1 * 5 - self.assert_compile(select([f]), + self.assert_compile(select([f]), "SELECT t1.col1 * :col1_1 AS anon_1 FROM t1") f.anon_label @@ -302,7 +302,7 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): a = t.alias() f = sql_util.ClauseAdapter(a).traverse(f) - self.assert_compile(select([f]), + self.assert_compile(select([f]), "SELECT t1_1.col1 * :col1_1 AS anon_1 FROM t1 AS t1_1") def test_join(self): @@ -323,7 +323,7 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): aliased = t1.select().alias() aliased2 = t1.alias() - + adapter = sql_util.ColumnAdapter(aliased) f = select([ @@ -333,7 +333,7 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): s = select([aliased2]).select_from(aliased) eq_(str(s), str(f)) - + f = select([ adapter.columns[func.count(aliased2.c.col1)] ]).select_from(aliased) @@ -352,7 +352,7 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): # fixed by [ticket:2419]. the inside columns # on aliased3 have _is_clone_of pointers to those of - # aliased2. corresponding_column checks these + # aliased2. corresponding_column checks these # now. adapter = sql_util.ColumnAdapter(aliased1) f1 = select([ @@ -376,7 +376,7 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): aliased3 = cloned_traverse(aliased2, {}, {}) # also fixed by [ticket:2419]. When we look at the - # *outside* columns of aliased3, they previously did not + # *outside* columns of aliased3, they previously did not # have an _is_clone_of pointer. But we now modified _make_proxy # to assign this. adapter = sql_util.ColumnAdapter(aliased1) @@ -401,7 +401,7 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): aliased3 = cloned_traverse(aliased2, {}, {}) # also fixed by [ticket:2419]. When we look at the - # *outside* columns of aliased3, they previously did not + # *outside* columns of aliased3, they previously did not # have an _is_clone_of pointer. But we now modified _make_proxy # to assign this. adapter = sql_util.ColumnAdapter(aliased1) @@ -517,14 +517,14 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): assert sql_util.ClauseAdapter(u).traverse(t1) is u def test_binds(self): - """test that unique bindparams change their name upon clone() + """test that unique bindparams change their name upon clone() to prevent conflicts""" s = select([t1], t1.c.col1==bindparam(None, unique=True)).alias() s2 = CloningVisitor().traverse(s).alias() s3 = select([s], s.c.col2==s2.c.col2) - self.assert_compile(s3, + self.assert_compile(s3, "SELECT anon_1.col1, anon_1.col2, anon_1.col3 FROM " "(SELECT table1.col1 AS col1, table1.col2 AS col2, " "table1.col3 AS col3 FROM table1 WHERE table1.col1 = :param_1) " @@ -536,7 +536,7 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): s = select([t1], t1.c.col1==4).alias() s2 = CloningVisitor().traverse(s).alias() s3 = select([s], s.c.col2==s2.c.col2) - self.assert_compile(s3, + self.assert_compile(s3, "SELECT anon_1.col1, anon_1.col2, anon_1.col3 FROM " "(SELECT table1.col1 AS col1, table1.col2 AS col2, " "table1.col3 AS col3 FROM table1 WHERE table1.col1 = :col1_1) " @@ -547,14 +547,14 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): def test_extract(self): s = select([extract('foo', t1.c.col1).label('col1')]) - self.assert_compile(s, + self.assert_compile(s, "SELECT EXTRACT(foo FROM table1.col1) AS col1 FROM table1") s2 = CloningVisitor().traverse(s).alias() s3 = select([s2.c.col1]) - self.assert_compile(s, + self.assert_compile(s, "SELECT EXTRACT(foo FROM table1.col1) AS col1 FROM table1") - self.assert_compile(s3, + self.assert_compile(s3, "SELECT anon_1.col1 FROM (SELECT EXTRACT(foo FROM " "table1.col1) AS col1 FROM table1) AS anon_1") @@ -562,8 +562,8 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): @testing.emits_warning('.*replaced by another column with the same key') def test_alias(self): subq = t2.select().alias('subq') - s = select([t1.c.col1, subq.c.col1], - from_obj=[t1, subq, + s = select([t1.c.col1, subq.c.col1], + from_obj=[t1, subq, t1.join(subq, t1.c.col1==subq.c.col2)] ) orig = str(s) @@ -580,21 +580,21 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL): assert orig == str(s) == str(s3) == str(s4) subq = subq.alias('subq') - s = select([t1.c.col1, subq.c.col1], - from_obj=[t1, subq, + s = select([t1.c.col1, subq.c.col1], + from_obj=[t1, subq, t1.join(subq, t1.c.col1==subq.c.col2)] ) s5 = CloningVisitor().traverse(s) assert orig == str(s) == str(s5) def test_correlated_select(self): - s = select(['*'], t1.c.col1==t2.c.col1, + s = select(['*'], t1.c.col1==t2.c.col1, from_obj=[t1, t2]).correlate(t2) class Vis(CloningVisitor): def visit_select(self, select): select.append_whereclause(t1.c.col2==7) - self.assert_compile(Vis().traverse(s), + self.assert_compile(Vis().traverse(s), "SELECT * FROM table1 WHERE table1.col1 = table2.col1 " "AND table1.col2 = :col2_1") @@ -851,8 +851,8 @@ class ClauseAdapterTest(fixtures.TestBase, AssertsCompiledSQL): m = MetaData() a=Table( 'a',m, Column( 'id', Integer, primary_key=True), - Column( 'xxx_id', Integer, - ForeignKey( 'a.id', name='adf',use_alter=True ) + Column( 'xxx_id', Integer, + ForeignKey( 'a.id', name='adf',use_alter=True ) ) ) @@ -887,7 +887,7 @@ class ClauseAdapterTest(fixtures.TestBase, AssertsCompiledSQL): alias = select([a]).select_from(a.join(b, a.c.x==b.c.x)).alias() - # two levels of indirection from c.x->b.x->a.x, requires recursive + # two levels of indirection from c.x->b.x->a.x, requires recursive # corresponding_column call adapt = sql_util.ClauseAdapter(alias, equivalents={b.c.x: set([a.c.x]), c.c.x: set([b.c.x])}) @@ -1267,7 +1267,7 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL): assert_raises( exc.ArgumentError, - select().execution_options, + select().execution_options, isolation_level='READ_COMMITTED' ) diff --git a/test/sql/test_labels.py b/test/sql/test_labels.py index 7c65a1d01..c814a0130 100644 --- a/test/sql/test_labels.py +++ b/test/sql/test_labels.py @@ -27,14 +27,14 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): def define_tables(cls, metadata): table1 = Table("some_large_named_table", metadata, Column("this_is_the_primarykey_column", Integer, - primary_key=True, + primary_key=True, test_needs_autoincrement=True), Column("this_is_the_data_column", String(30)) ) table2 = Table("table_with_exactly_29_characs", metadata, Column("this_is_the_primarykey_column", Integer, - primary_key=True, + primary_key=True, test_needs_autoincrement=True), Column("this_is_the_data_column", String(30)) ) @@ -46,13 +46,13 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): table1 = cls.tables.table1 table2 = cls.tables.table2 for data in [ - {"this_is_the_primarykey_column":1, + {"this_is_the_primarykey_column":1, "this_is_the_data_column":"data1"}, - {"this_is_the_primarykey_column":2, + {"this_is_the_primarykey_column":2, "this_is_the_data_column":"data2"}, - {"this_is_the_primarykey_column":3, + {"this_is_the_primarykey_column":3, "this_is_the_data_column":"data3"}, - {"this_is_the_primarykey_column":4, + {"this_is_the_primarykey_column":4, "this_is_the_data_column":"data4"} ]: testing.db.execute( @@ -61,7 +61,7 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): ) testing.db.execute( table2.insert(), - {"this_is_the_primary_key_column":1, + {"this_is_the_primary_key_column":1, "this_is_the_data_column":"data"} ) @@ -78,7 +78,7 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): def test_too_long_name_disallowed(self): m = MetaData(testing.db) - t1 = Table("this_name_is_too_long_for_what_were_doing_in_this_test", + t1 = Table("this_name_is_too_long_for_what_were_doing_in_this_test", m, Column('foo', Integer)) assert_raises(exceptions.IdentifierError, m.create_all) assert_raises(exceptions.IdentifierError, m.drop_all) @@ -87,11 +87,11 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): def test_basic_result(self): table1 = self.tables.table1 - s = table1.select(use_labels=True, + s = table1.select(use_labels=True, order_by=[table1.c.this_is_the_primarykey_column]) result = [ - (row[table1.c.this_is_the_primarykey_column], + (row[table1.c.this_is_the_primarykey_column], row[table1.c.this_is_the_data_column]) for row in testing.db.execute(s) ] @@ -104,18 +104,18 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): def test_result_limit(self): table1 = self.tables.table1 - # some dialects such as oracle (and possibly ms-sql + # some dialects such as oracle (and possibly ms-sql # in a future version) # generate a subquery for limits/offsets. - # ensure that the generated result map corresponds + # ensure that the generated result map corresponds # to the selected table, not # the select query - s = table1.select(use_labels=True, + s = table1.select(use_labels=True, order_by=[table1.c.this_is_the_primarykey_column]).\ limit(2) result = [ - (row[table1.c.this_is_the_primarykey_column], + (row[table1.c.this_is_the_primarykey_column], row[table1.c.this_is_the_data_column]) for row in testing.db.execute(s) ] @@ -127,12 +127,12 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): @testing.requires.offset def test_result_limit_offset(self): table1 = self.tables.table1 - s = table1.select(use_labels=True, + s = table1.select(use_labels=True, order_by=[table1.c.this_is_the_primarykey_column]).\ limit(2).offset(1) result = [ - (row[table1.c.this_is_the_primarykey_column], + (row[table1.c.this_is_the_primarykey_column], row[table1.c.this_is_the_data_column]) for row in testing.db.execute(s) ] @@ -170,7 +170,7 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): dialect.max_identifier_length = IDENT_LENGTH self.assert_compile( select([table1, ta]).select_from( - table1.join(ta, + table1.join(ta, table1.c.this_is_the_data_column== ta.c.this_is_the_data_column)).\ where(ta.c.this_is_the_data_column=='data3'), @@ -210,13 +210,13 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): @testing.provide_metadata def test_insert_no_pk(self): t = Table("some_other_large_named_table", self.metadata, - Column("this_is_the_primarykey_column", Integer, - Sequence("this_is_some_large_seq"), + Column("this_is_the_primarykey_column", Integer, + Sequence("this_is_some_large_seq"), primary_key=True), Column("this_is_the_data_column", String(30)) ) t.create(testing.db, checkfirst=True) - testing.db.execute(t.insert(), + testing.db.execute(t.insert(), **{"this_is_the_data_column":"data1"}) @testing.requires.subqueries @@ -238,7 +238,7 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): q = table1.select(table1.c.this_is_the_primarykey_column == 4).alias() x = select([q], use_labels=True) - self.assert_compile(x, + self.assert_compile(x, "SELECT anon_1.this_is_the_primarykey_column AS " "anon_1_this_is_the_prim_1, anon_1.this_is_the_data_column " "AS anon_1_this_is_the_data_2 " @@ -249,7 +249,7 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): "AS this_is_the_data_column " "FROM some_large_named_table " "WHERE some_large_named_table.this_is_the_primarykey_column " - "= :this_is_the_primarykey__1) AS anon_1", + "= :this_is_the_primarykey__1) AS anon_1", dialect=compile_dialect) eq_( @@ -264,13 +264,13 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): x = select([q]) compile_dialect = default.DefaultDialect(label_length=10) - self.assert_compile(x, + self.assert_compile(x, "SELECT foo.this_1, foo.this_2 FROM " "(SELECT some_large_named_table." "this_is_the_primarykey_column AS this_1, " "some_large_named_table.this_is_the_data_column AS this_2 " "FROM some_large_named_table WHERE " - "some_large_named_table.this_is_the_primarykey_column = :this_1) AS foo", + "some_large_named_table.this_is_the_primarykey_column = :this_1) AS foo", dialect=compile_dialect) compile_dialect = default.DefaultDialect(label_length=4) @@ -278,19 +278,19 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): "(SELECT some_large_named_table.this_is_the_primarykey_column " "AS _1, some_large_named_table.this_is_the_data_column AS _2 " "FROM some_large_named_table WHERE " - "some_large_named_table.this_is_the_primarykey_column = :_1) AS foo", + "some_large_named_table.this_is_the_primarykey_column = :_1) AS foo", dialect=compile_dialect) q = table1.select(table1.c.this_is_the_primarykey_column == 4).alias() x = select([q], use_labels=True) compile_dialect = default.DefaultDialect(label_length=10) - self.assert_compile(x, + self.assert_compile(x, "SELECT anon_1.this_2 AS anon_1, anon_1.this_4 AS anon_3 FROM " "(SELECT some_large_named_table.this_is_the_primarykey_column " "AS this_2, some_large_named_table.this_is_the_data_column AS this_4 " "FROM some_large_named_table WHERE " - "some_large_named_table.this_is_the_primarykey_column = :this_1) AS anon_1", + "some_large_named_table.this_is_the_primarykey_column = :this_1) AS anon_1", dialect=compile_dialect) compile_dialect = default.DefaultDialect(label_length=4) @@ -298,7 +298,7 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): "(SELECT some_large_named_table.this_is_the_primarykey_column " "AS _2, some_large_named_table.this_is_the_data_column AS _4 " "FROM some_large_named_table WHERE " - "some_large_named_table.this_is_the_primarykey_column = :_1) AS _1", + "some_large_named_table.this_is_the_primarykey_column = :_1) AS _1", dialect=compile_dialect) def test_adjustable_result_schema_column(self): @@ -321,7 +321,7 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL): def test_adjustable_result_lightweight_column(self): - table1 = table("some_large_named_table", + table1 = table("some_large_named_table", column("this_is_the_primarykey_column"), column("this_is_the_data_column") ) diff --git a/test/sql/test_metadata.py b/test/sql/test_metadata.py index ecbf8ad75..3e9f87fe7 100644 --- a/test/sql/test_metadata.py +++ b/test/sql/test_metadata.py @@ -19,7 +19,7 @@ from test.lib.testing import eq_ class MetaDataTest(fixtures.TestBase, ComparesTables): def test_metadata_connect(self): metadata = MetaData() - t1 = Table('table1', metadata, + t1 = Table('table1', metadata, Column('col1', Integer, primary_key=True), Column('col2', String(20))) metadata.bind = testing.db @@ -58,7 +58,7 @@ class MetaDataTest(fixtures.TestBase, ComparesTables): Column('bar', Integer(), info={'foo':'bar'}), ]: c2 = col.copy() - for attr in ('name', 'type', 'nullable', + for attr in ('name', 'type', 'nullable', 'primary_key', 'key', 'unique', 'info', 'doc'): eq_(getattr(col, attr), getattr(c2, attr)) @@ -148,14 +148,14 @@ class MetaDataTest(fixtures.TestBase, ComparesTables): @testing.provide_metadata def test_dupe_tables(self): metadata = self.metadata - t1 = Table('table1', metadata, + t1 = Table('table1', metadata, Column('col1', Integer, primary_key=True), Column('col2', String(20))) metadata.create_all() t1 = Table('table1', metadata, autoload=True) def go(): - t2 = Table('table1', metadata, + t2 = Table('table1', metadata, Column('col1', Integer, primary_key=True), Column('col2', String(20))) assert_raises_message( @@ -173,11 +173,11 @@ class MetaDataTest(fixtures.TestBase, ComparesTables): m = MetaData() t1 = Table('t', m, c1, c2) - kw = dict(onupdate="X", + kw = dict(onupdate="X", ondelete="Y", use_alter=True, name='f1', deferrable="Z", initially="Q", link_to_name=True) - fk1 = ForeignKey(c1, **kw) + fk1 = ForeignKey(c1, **kw) fk2 = ForeignKeyConstraint((c1,), (c2,), **kw) t1.append_constraint(fk2) @@ -190,10 +190,10 @@ class MetaDataTest(fixtures.TestBase, ComparesTables): def test_check_constraint_copy(self): r = lambda x: x - c = CheckConstraint("foo bar", - name='name', - initially=True, - deferrable=True, + c = CheckConstraint("foo bar", + name='name', + initially=True, + deferrable=True, _create_rule = r) c2 = c.copy() eq_(c2.name, 'name') @@ -273,7 +273,7 @@ class MetaDataTest(fixtures.TestBase, ComparesTables): table2 = Table('othertable', meta, Column('id', Integer, Sequence('foo_seq'), primary_key=True), - Column('myid', Integer, + Column('myid', Integer, ForeignKey('mytable.myid'), ), test_needs_fk=True, @@ -359,7 +359,7 @@ class MetaDataTest(fixtures.TestBase, ComparesTables): m2 = pickle.loads(pickle.dumps(m1)) s2 = Sequence("x_seq") - t2 = Table('a', m2, + t2 = Table('a', m2, Column('id',Integer,primary_key=True), Column('x', Integer, s2), extend_existing=True) @@ -373,7 +373,7 @@ class MetaDataTest(fixtures.TestBase, ComparesTables): m1 = MetaData() s1 = Sequence("x_seq") - t = Table('a', m1, + t = Table('a', m1, Column('x', Integer, s1) ) assert m1._sequences['x_seq'] is s1 @@ -601,9 +601,9 @@ class MetaDataTest(fixtures.TestBase, ComparesTables): table_c = table.tometadata(meta2, schema=None) table2_c = table2.tometadata(meta2, schema=None) - eq_(str(table_c.join(table2_c).onclause), + eq_(str(table_c.join(table2_c).onclause), str(table_c.c.myid == table2_c.c.myid)) - eq_(str(table_c.join(table2_c).onclause), + eq_(str(table_c.join(table2_c).onclause), "someschema.mytable.myid = someschema.othertable.myid") def test_tometadata_strip_schema(self): @@ -644,21 +644,21 @@ class MetaDataTest(fixtures.TestBase, ComparesTables): ck = schema.CheckConstraint("x > y", name="someconstraint") for const, exp in ( - (Sequence("my_seq"), + (Sequence("my_seq"), "Sequence('my_seq')"), - (Sequence("my_seq", start=5), + (Sequence("my_seq", start=5), "Sequence('my_seq', start=5)"), - (Column("foo", Integer), + (Column("foo", Integer), "Column('foo', Integer(), table=None)"), - (Table("bar", MetaData(), Column("x", String)), + (Table("bar", MetaData(), Column("x", String)), "Table('bar', MetaData(bind=None), " "Column('x', String(), table=<bar>), schema=None)"), - (schema.DefaultGenerator(for_update=True), + (schema.DefaultGenerator(for_update=True), "DefaultGenerator(for_update=True)"), (schema.Index("bar", "c"), "Index('bar')"), (i1, "Index('bar', Column('x', Integer(), table=<foo>))"), (schema.FetchedValue(), "FetchedValue()"), - (ck, + (ck, "CheckConstraint(" "%s" ", name='someconstraint')" % repr(ck.sqltext)), @@ -675,7 +675,7 @@ class TableTest(fixtures.TestBase, AssertsCompiledSQL): prefixes = ["TEMPORARY"]) self.assert_compile( - schema.CreateTable(table1), + schema.CreateTable(table1), "CREATE TEMPORARY TABLE temporary_table_1 (col1 INTEGER)" ) @@ -683,7 +683,7 @@ class TableTest(fixtures.TestBase, AssertsCompiledSQL): Column("col1", Integer), prefixes = ["VIRTUAL"]) self.assert_compile( - schema.CreateTable(table2), + schema.CreateTable(table2), "CREATE VIRTUAL TABLE temporary_table_2 (col1 INTEGER)" ) @@ -741,7 +741,7 @@ class SchemaTest(fixtures.TestBase, AssertsCompiledSQL): def test_default_schema_metadata_fk_alt_remote(self): m = MetaData(schema="foo") t1 = Table('t1', m, Column('x', Integer)) - t2 = Table('t2', m, Column('x', Integer, ForeignKey('t1.x')), + t2 = Table('t2', m, Column('x', Integer, ForeignKey('t1.x')), schema="bar") assert t2.c.x.references(t1.c.x) @@ -797,8 +797,8 @@ class SchemaTest(fixtures.TestBase, AssertsCompiledSQL): class UseExistingTest(fixtures.TablesTest): @classmethod def define_tables(cls, metadata): - Table('users', metadata, - Column('id', Integer, primary_key=True), + Table('users', metadata, + Column('id', Integer, primary_key=True), Column('name', String(30))) def _useexisting_fixture(self): @@ -836,7 +836,7 @@ class UseExistingTest(fixtures.TablesTest): meta2 = self._useexisting_fixture() assert_raises( exc.ArgumentError, - Table, 'users', meta2, keep_existing=True, + Table, 'users', meta2, keep_existing=True, extend_existing=True ) @@ -845,13 +845,13 @@ class UseExistingTest(fixtures.TablesTest): meta2 = self._useexisting_fixture() assert_raises( exc.ArgumentError, - Table, 'users', meta2, useexisting=True, + Table, 'users', meta2, useexisting=True, extend_existing=True ) def test_keep_existing_no_dupe_constraints(self): meta2 = self._notexisting_fixture() - users = Table('users', meta2, + users = Table('users', meta2, Column('id', Integer), Column('name', Unicode), UniqueConstraint('name'), @@ -861,7 +861,7 @@ class UseExistingTest(fixtures.TablesTest): assert 'id' in users.c eq_(len(users.constraints), 2) - u2 = Table('users', meta2, + u2 = Table('users', meta2, Column('id', Integer), Column('name', Unicode), UniqueConstraint('name'), @@ -871,7 +871,7 @@ class UseExistingTest(fixtures.TablesTest): def test_extend_existing_dupes_constraints(self): meta2 = self._notexisting_fixture() - users = Table('users', meta2, + users = Table('users', meta2, Column('id', Integer), Column('name', Unicode), UniqueConstraint('name'), @@ -881,7 +881,7 @@ class UseExistingTest(fixtures.TablesTest): assert 'id' in users.c eq_(len(users.constraints), 2) - u2 = Table('users', meta2, + u2 = Table('users', meta2, Column('id', Integer), Column('name', Unicode), UniqueConstraint('name'), @@ -904,7 +904,7 @@ class UseExistingTest(fixtures.TablesTest): def test_keep_existing_add_column(self): meta2 = self._useexisting_fixture() - users = Table('users', meta2, + users = Table('users', meta2, Column('foo', Integer), autoload=True, keep_existing=True) @@ -918,14 +918,14 @@ class UseExistingTest(fixtures.TablesTest): def test_keep_existing_quote_no_orig(self): meta2 = self._notexisting_fixture() - users = Table('users', meta2, quote=True, + users = Table('users', meta2, quote=True, autoload=True, keep_existing=True) assert users.quote def test_keep_existing_add_column_no_orig(self): meta2 = self._notexisting_fixture() - users = Table('users', meta2, + users = Table('users', meta2, Column('foo', Integer), autoload=True, keep_existing=True) @@ -939,13 +939,13 @@ class UseExistingTest(fixtures.TablesTest): def test_keep_existing_quote_no_reflection(self): meta2 = self._useexisting_fixture() - users = Table('users', meta2, quote=True, + users = Table('users', meta2, quote=True, keep_existing=True) assert not users.quote def test_keep_existing_add_column_no_reflection(self): meta2 = self._useexisting_fixture() - users = Table('users', meta2, + users = Table('users', meta2, Column('foo', Integer), keep_existing=True) assert "foo" not in users.c @@ -964,7 +964,7 @@ class UseExistingTest(fixtures.TablesTest): def test_extend_existing_add_column(self): meta2 = self._useexisting_fixture() - users = Table('users', meta2, + users = Table('users', meta2, Column('foo', Integer), autoload=True, extend_existing=True) @@ -978,14 +978,14 @@ class UseExistingTest(fixtures.TablesTest): def test_extend_existing_quote_no_orig(self): meta2 = self._notexisting_fixture() - users = Table('users', meta2, quote=True, + users = Table('users', meta2, quote=True, autoload=True, extend_existing=True) assert users.quote def test_extend_existing_add_column_no_orig(self): meta2 = self._notexisting_fixture() - users = Table('users', meta2, + users = Table('users', meta2, Column('foo', Integer), autoload=True, extend_existing=True) @@ -999,13 +999,13 @@ class UseExistingTest(fixtures.TablesTest): def test_extend_existing_quote_no_reflection(self): meta2 = self._useexisting_fixture() - users = Table('users', meta2, quote=True, + users = Table('users', meta2, quote=True, extend_existing=True) assert users.quote def test_extend_existing_add_column_no_reflection(self): meta2 = self._useexisting_fixture() - users = Table('users', meta2, + users = Table('users', meta2, Column('foo', Integer), extend_existing=True) assert "foo" in users.c @@ -1014,16 +1014,16 @@ class ConstraintTest(fixtures.TestBase): def _single_fixture(self): m = MetaData() - t1 = Table('t1', m, + t1 = Table('t1', m, Column('a', Integer), Column('b', Integer) ) - t2 = Table('t2', m, + t2 = Table('t2', m, Column('a', Integer, ForeignKey('t1.a')) ) - t3 = Table('t3', m, + t3 = Table('t3', m, Column('a', Integer) ) return t1, t2, t3 @@ -1090,7 +1090,7 @@ class ColumnDefinitionTest(AssertsCompiledSQL, fixtures.TestBase): c = Column(Integer) assert_raises_message( - exc.ArgumentError, + exc.ArgumentError, "Column must be constructed with a non-blank name or assign a " "non-blank .name ", Table, 't', MetaData(), c) @@ -1099,7 +1099,7 @@ class ColumnDefinitionTest(AssertsCompiledSQL, fixtures.TestBase): c = Column('', Integer) assert_raises_message( - exc.ArgumentError, + exc.ArgumentError, "Column must be constructed with a non-blank name or assign a " "non-blank .name ", Table, 't', MetaData(), c) @@ -1109,7 +1109,7 @@ class ColumnDefinitionTest(AssertsCompiledSQL, fixtures.TestBase): t = Table('t', MetaData(), c) assert_raises_message( - exc.ArgumentError, + exc.ArgumentError, "Column object already assigned to Table 't'", Table, 'q', MetaData(), c) @@ -1335,7 +1335,7 @@ class CatchAllEventsTest(fixtures.TestBase): event.listen(schema.SchemaItem, "after_parent_attach", after_attach) m = MetaData() - t1 = Table('t1', m, + t1 = Table('t1', m, Column('id', Integer, Sequence('foo_id'), primary_key=True), Column('bar', String, ForeignKey('t2.id')) ) @@ -1375,7 +1375,7 @@ class CatchAllEventsTest(fixtures.TestBase): evt(target) m = MetaData() - t1 = Table('t1', m, + t1 = Table('t1', m, Column('id', Integer, Sequence('foo_id'), primary_key=True), Column('bar', String, ForeignKey('t2.id')), Column('bat', Integer, unique=True), @@ -1390,10 +1390,10 @@ class CatchAllEventsTest(fixtures.TestBase): eq_( canary, [ - 'PrimaryKeyConstraint->Table', 'PrimaryKeyConstraint->t1', + 'PrimaryKeyConstraint->Table', 'PrimaryKeyConstraint->t1', 'ForeignKeyConstraint->Table', 'ForeignKeyConstraint->t1', 'UniqueConstraint->Table', 'UniqueConstraint->t1', - 'PrimaryKeyConstraint->Table', 'PrimaryKeyConstraint->t2', + 'PrimaryKeyConstraint->Table', 'PrimaryKeyConstraint->t2', 'CheckConstraint->Table', 'CheckConstraint->t2', 'UniqueConstraint->Table', 'UniqueConstraint->t2' ] diff --git a/test/sql/test_query.py b/test/sql/test_query.py index 8a439c15c..0aefd4007 100644 --- a/test/sql/test_query.py +++ b/test/sql/test_query.py @@ -49,7 +49,7 @@ class QueryTest(fixtures.TestBase): def test_insert_heterogeneous_params(self): """test that executemany parameters are asserted to match the parameter set of the first.""" - assert_raises_message(exc.StatementError, + assert_raises_message(exc.StatementError, r"A value is required for bind parameter 'user_name', in " "parameter group 2 \(original cause: (sqlalchemy.exc.)?InvalidRequestError: A " "value is required for bind parameter 'user_name', in " @@ -60,7 +60,7 @@ class QueryTest(fixtures.TestBase): {'user_id':9} ) - # this succeeds however. We aren't yet doing + # this succeeds however. We aren't yet doing # a length check on all subsequent parameters. users.insert().execute( {'user_id':7}, @@ -99,7 +99,7 @@ class QueryTest(fixtures.TestBase): ret[col.key] = id if result.lastrow_has_defaults(): - criterion = and_(*[col==id for col, id in + criterion = and_(*[col==id for col, id in zip(table.primary_key, result.inserted_primary_key)]) row = engine.execute(table.select(criterion)).first() for c in table.c: @@ -217,7 +217,7 @@ class QueryTest(fixtures.TestBase): for engine in test_engines: - r = engine.execute(users.insert(), + r = engine.execute(users.insert(), {'user_name':'jack'}, ) assert r.closed @@ -312,7 +312,7 @@ class QueryTest(fixtures.TestBase): content = Table('content', self.metadata, Column('type', String(30)), ) - bar = Table('bar', self.metadata, + bar = Table('bar', self.metadata, Column('content_type', String(30)) ) self.metadata.create_all(testing.db) @@ -348,7 +348,7 @@ class QueryTest(fixtures.TestBase): result = util.pickle.loads(util.pickle.dumps(result)) eq_( - result, + result, [(7, "jack"), (8, "ed"), (9, "fred")] ) if use_labels: @@ -365,7 +365,7 @@ class QueryTest(fixtures.TestBase): if not pickle or use_labels: assert_raises(exc.NoSuchColumnError, lambda: result[0][addresses.c.user_id]) else: - # test with a different table. name resolution is + # test with a different table. name resolution is # causing 'user_id' to match when use_labels wasn't used. eq_(result[0][addresses.c.user_id], 7) @@ -387,7 +387,7 @@ class QueryTest(fixtures.TestBase): (unprintable(), "unprintable element.*"), ]: assert_raises_message( - exc.NoSuchColumnError, + exc.NoSuchColumnError, msg % repl, lambda: row[accessor] ) @@ -740,7 +740,7 @@ class QueryTest(fixtures.TestBase): dict(user_id=1, user_name='john'), ) - # test a little sqlite weirdness - with the UNION, + # test a little sqlite weirdness - with the UNION, # cols come back as "query_users.user_id" in cursor.description r = text("select query_users.user_id, query_users.user_name from query_users " "UNION select query_users.user_id, query_users.user_name from query_users", @@ -785,7 +785,7 @@ class QueryTest(fixtures.TestBase): ) # test using literal tablename.colname r = text('select query_users.user_id AS "query_users.user_id", ' - 'query_users.user_name AS "query_users.user_name" from query_users', + 'query_users.user_name AS "query_users.user_name" from query_users', bind=testing.db).execution_options(sqlite_raw_colnames=True).execute().first() eq_(r['query_users.user_id'], 1) eq_(r['query_users.user_name'], "john") @@ -1054,9 +1054,9 @@ class QueryTest(fixtures.TestBase): ) shadowed.create(checkfirst=True) try: - shadowed.insert().execute(shadow_id=1, shadow_name='The Shadow', parent='The Light', - row='Without light there is no shadow', - _parent='Hidden parent', + shadowed.insert().execute(shadow_id=1, shadow_name='The Shadow', parent='The Light', + row='Without light there is no shadow', + _parent='Hidden parent', _row='Hidden row') r = shadowed.select(shadowed.c.shadow_id==1).execute().first() self.assert_(r.shadow_id == r['shadow_id'] == r[shadowed.c.shadow_id] == 1) @@ -1104,7 +1104,7 @@ class QueryTest(fixtures.TestBase): @testing.fails_on('firebird', "uses sql-92 rules") @testing.fails_on('sybase', "uses sql-92 rules") @testing.fails_on('mssql+mxodbc', "uses sql-92 rules") - @testing.fails_if(lambda: + @testing.fails_if(lambda: testing.against('mssql+pyodbc') and not testing.db.dialect.freetds, "uses sql-92 rules") def test_bind_in(self): @@ -1144,7 +1144,7 @@ class QueryTest(fixtures.TestBase): @testing.emits_warning('.*empty sequence.*') @testing.requires.boolean_col_expressions def test_in_filtering_advanced(self): - """test the behavior of the in_() function when + """test the behavior of the in_() function when comparing against an empty collection, specifically that a proper boolean value is generated. @@ -1167,7 +1167,7 @@ class QueryTest(fixtures.TestBase): class PercentSchemaNamesTest(fixtures.TestBase): """tests using percent signs, spaces in table and column names. - Doesn't pass for mysql, postgresql, but this is really a + Doesn't pass for mysql, postgresql, but this is really a SQLAlchemy bug - we should be escaping out %% signs for this operation the same way we do for text() and column labels. @@ -1181,7 +1181,7 @@ class PercentSchemaNamesTest(fixtures.TestBase): Column("percent%", Integer), Column("spaces % more spaces", Integer), ) - lightweight_percent_table = sql.table('percent%table', + lightweight_percent_table = sql.table('percent%table', sql.column("percent%"), sql.column("spaces % more spaces"), ) @@ -1194,7 +1194,7 @@ class PercentSchemaNamesTest(fixtures.TestBase): def teardown_class(cls): metadata.drop_all() - @testing.skip_if(lambda: testing.against('postgresql'), + @testing.skip_if(lambda: testing.against('postgresql'), "psycopg2 2.4 no longer accepts % in bind placeholders") def test_single_roundtrip(self): percent_table.insert().execute( @@ -1211,7 +1211,7 @@ class PercentSchemaNamesTest(fixtures.TestBase): ) self._assert_table() - @testing.skip_if(lambda: testing.against('postgresql'), + @testing.skip_if(lambda: testing.against('postgresql'), "psycopg2 2.4 no longer accepts % in bind placeholders") @testing.crashes('mysql+mysqldb', "MySQLdb handles executemany() " "inconsistently vs. execute()") @@ -1228,9 +1228,9 @@ class PercentSchemaNamesTest(fixtures.TestBase): def _assert_table(self): for table in ( - percent_table, - percent_table.alias(), - lightweight_percent_table, + percent_table, + percent_table.alias(), + lightweight_percent_table, lightweight_percent_table.alias()): eq_( list( @@ -1314,7 +1314,7 @@ class KeyTargetingTest(fixtures.TablesTest): content = Table('content', metadata, Column('t', String(30), key="type"), ) - bar = Table('bar', metadata, + bar = Table('bar', metadata, Column('ctype', String(30), key="content_type") ) @@ -1611,7 +1611,7 @@ class CompoundTest(fixtures.TestBase): eq_(found2, wanted) def test_union_all_lightweight(self): - """like test_union_all, but breaks the sub-union into + """like test_union_all, but breaks the sub-union into a subquery with an explicit column reference on the outside, more palatable to a wider variety of engines. diff --git a/test/sql/test_quote.py b/test/sql/test_quote.py index 952b14763..a714002b1 100644 --- a/test/sql/test_quote.py +++ b/test/sql/test_quote.py @@ -94,7 +94,7 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL): self.assert_compile(t1.select().apply_labels(), '''SELECT "foo"."t1"."col1" AS "foo_t1_col1" FROM "foo"."t1"''') a = t1.select().alias('anon') b = select([1], a.c.col1==2, from_obj=a) - self.assert_compile(b, + self.assert_compile(b, '''SELECT 1 FROM (SELECT "foo"."t1"."col1" AS "col1" FROM '''\ '''"foo"."t1") AS anon WHERE anon."col1" = :col1_1''' ) @@ -104,15 +104,15 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL): Column('ColumnOne', Integer, quote=False), quote=False, schema="FooBar", quote_schema=False) self.assert_compile(t1.select(), "SELECT FooBar.TableOne.ColumnOne FROM FooBar.TableOne") - self.assert_compile(t1.select().apply_labels(), + self.assert_compile(t1.select().apply_labels(), "SELECT FooBar.TableOne.ColumnOne AS "\ - "FooBar_TableOne_ColumnOne FROM FooBar.TableOne" # TODO: is this what we really want here ? what if table/schema + "FooBar_TableOne_ColumnOne FROM FooBar.TableOne" # TODO: is this what we really want here ? what if table/schema # *are* quoted? ) a = t1.select().alias('anon') b = select([1], a.c.ColumnOne==2, from_obj=a) - self.assert_compile(b, + self.assert_compile(b, "SELECT 1 FROM (SELECT FooBar.TableOne.ColumnOne AS "\ "ColumnOne FROM FooBar.TableOne) AS anon WHERE anon.ColumnOne = :ColumnOne_1" ) @@ -142,8 +142,8 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL): if labels arent quoted, a query in postgresql in particular will fail since it produces: SELECT LaLa.lowercase, LaLa."UPPERCASE", LaLa."MixedCase", LaLa."ASC" - FROM (SELECT DISTINCT "WorstCase1".lowercase AS lowercase, - "WorstCase1"."UPPERCASE" AS UPPERCASE, + FROM (SELECT DISTINCT "WorstCase1".lowercase AS lowercase, + "WorstCase1"."UPPERCASE" AS UPPERCASE, "WorstCase1"."MixedCase" AS MixedCase, "WorstCase1"."ASC" AS ASC \nFROM "WorstCase1") AS LaLa where the "UPPERCASE" column of "LaLa" doesnt exist. @@ -179,7 +179,7 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL): Column("order", Integer)) x = select([table.c.col1, table.c['from'], table.c.louisville, table.c.order]) - self.assert_compile(x, + self.assert_compile(x, '''SELECT "ImATable".col1, "ImATable"."from", "ImATable".louisville, "ImATable"."order" FROM "ImATable"''') diff --git a/test/sql/test_rowcount.py b/test/sql/test_rowcount.py index 5d95baa81..c14fa22a1 100644 --- a/test/sql/test_rowcount.py +++ b/test/sql/test_rowcount.py @@ -13,8 +13,8 @@ class FoundRowsTest(fixtures.TestBase, AssertsExecutionResults): metadata = MetaData(testing.db) employees_table = Table('employees', metadata, - Column('employee_id', Integer, - Sequence('employee_id_seq', optional=True), + Column('employee_id', Integer, + Sequence('employee_id_seq', optional=True), primary_key=True), Column('name', String(50)), Column('department', String(1)), diff --git a/test/sql/test_types.py b/test/sql/test_types.py index 659c7f2ae..91bf17175 100644 --- a/test/sql/test_types.py +++ b/test/sql/test_types.py @@ -26,7 +26,7 @@ class AdaptTest(fixtures.TestBase): ] def _all_dialects(self): - return [d.base.dialect() for d in + return [d.base.dialect() for d in self._all_dialect_modules()] def _types_for_mod(self, mod): @@ -327,11 +327,11 @@ class UserDefinedTest(fixtures.TablesTest, AssertsCompiledSQL): self.assert_compile(t, "VARCHAR(50)", dialect=sl) self.assert_compile(t, "FLOAT", dialect=pg) eq_( - t.dialect_impl(dialect=sl).impl.__class__, + t.dialect_impl(dialect=sl).impl.__class__, String().dialect_impl(dialect=sl).__class__ ) eq_( - t.dialect_impl(dialect=pg).impl.__class__, + t.dialect_impl(dialect=pg).impl.__class__, Float().dialect_impl(pg).__class__ ) @@ -695,8 +695,8 @@ class UnicodeTest(fixtures.TestBase, AssertsExecutionResults): ('oracle','cx_oracle'), )), \ "name: %s driver %s returns_unicode_strings=%s" % \ - (testing.db.name, - testing.db.driver, + (testing.db.name, + testing.db.driver, testing.db.dialect.returns_unicode_strings) def test_round_trip(self): @@ -787,7 +787,7 @@ class UnicodeTest(fixtures.TestBase, AssertsExecutionResults): eq_(uni(unicodedata), unicodedata.encode('utf-8')) - # using convert unicode at engine level - + # using convert unicode at engine level - # this should not be raising a warning unicode_engine = engines.utf8_engine(options={'convert_unicode':True,}) unicode_engine.dialect.supports_unicode_binds = False @@ -836,7 +836,7 @@ class UnicodeTest(fixtures.TestBase, AssertsExecutionResults): engine = engines.testing_engine(options={'encoding':'ascii'}) m.create_all(engine) try: - # insert a row that should be ascii and + # insert a row that should be ascii and # coerce from unicode with ignore on the bind side engine.execute( table.insert(), @@ -871,7 +871,7 @@ class UnicodeTest(fixtures.TestBase, AssertsExecutionResults): # one row will be ascii with ignores, # the other will be either ascii with the ignores - # or just the straight unicode+ utf8 value if the + # or just the straight unicode+ utf8 value if the # dialect just returns unicode result = engine.execute(table.select().order_by(table.c.sort)) ascii_row = result.fetchone() @@ -929,10 +929,10 @@ class EnumTest(fixtures.TestBase): def teardown_class(cls): metadata.drop_all() - @testing.fails_on('postgresql+zxjdbc', + @testing.fails_on('postgresql+zxjdbc', 'zxjdbc fails on ENUM: column "XXX" is of type XXX ' 'but expression is of type character varying') - @testing.fails_on('postgresql+pg8000', + @testing.fails_on('postgresql+pg8000', 'zxjdbc fails on ENUM: column "XXX" is of type XXX ' 'but expression is of type text') def test_round_trip(self): @@ -943,7 +943,7 @@ class EnumTest(fixtures.TestBase): ]) eq_( - enum_table.select().order_by(enum_table.c.id).execute().fetchall(), + enum_table.select().order_by(enum_table.c.id).execute().fetchall(), [ (1, 'two'), (2, 'two'), @@ -960,7 +960,7 @@ class EnumTest(fixtures.TestBase): eq_( non_native_enum_table.select(). - order_by(non_native_enum_table.c.id).execute().fetchall(), + order_by(non_native_enum_table.c.id).execute().fetchall(), [ (1, 'two'), (2, 'two'), @@ -978,19 +978,19 @@ class EnumTest(fixtures.TestBase): eq_(e1.adapt(ENUM).name, 'foo') eq_(e1.adapt(ENUM).schema, 'bar') - @testing.crashes('mysql', + @testing.crashes('mysql', 'Inconsistent behavior across various OS/drivers' ) def test_constraint(self): - assert_raises(exc.DBAPIError, + assert_raises(exc.DBAPIError, enum_table.insert().execute, {'id':4, 'someenum':'four'} ) - @testing.fails_on('mysql', + @testing.fails_on('mysql', "the CHECK constraint doesn't raise an exception for unknown reason") def test_non_native_constraint(self): - assert_raises(exc.DBAPIError, + assert_raises(exc.DBAPIError, non_native_enum_table.insert().execute, {'id':4, 'someenum':'four'} ) @@ -1004,7 +1004,7 @@ class EnumTest(fixtures.TestBase): Column('x', Enum("x", "y", name="pge")) ) t.create(e, checkfirst=False) - # basically looking for the start of + # basically looking for the start of # the constraint, or the ENUM def itself, # depending on backend. assert "('x'," in e.print_sql() @@ -1058,32 +1058,32 @@ class BinaryTest(fixtures.TestBase, AssertsExecutionResults): stream1 =self.load_stream('binary_data_one.dat') stream2 =self.load_stream('binary_data_two.dat') binary_table.insert().execute( - primary_id=1, - misc='binary_data_one.dat', - data=stream1, - data_slice=stream1[0:100], - pickled=testobj1, + primary_id=1, + misc='binary_data_one.dat', + data=stream1, + data_slice=stream1[0:100], + pickled=testobj1, mypickle=testobj3) binary_table.insert().execute( - primary_id=2, - misc='binary_data_two.dat', - data=stream2, - data_slice=stream2[0:99], + primary_id=2, + misc='binary_data_two.dat', + data=stream2, + data_slice=stream2[0:99], pickled=testobj2) binary_table.insert().execute( - primary_id=3, - misc='binary_data_two.dat', - data=None, - data_slice=stream2[0:99], + primary_id=3, + misc='binary_data_two.dat', + data=None, + data_slice=stream2[0:99], pickled=None) for stmt in ( binary_table.select(order_by=binary_table.c.primary_id), text( - "select * from binary_table order by binary_table.primary_id", - typemap={'pickled':PickleType, - 'mypickle':MyPickleType, - 'data':LargeBinary, 'data_slice':LargeBinary}, + "select * from binary_table order by binary_table.primary_id", + typemap={'pickled':PickleType, + 'mypickle':MyPickleType, + 'data':LargeBinary, 'data_slice':LargeBinary}, bind=testing.db) ): l = stmt.execute().fetchall() @@ -1154,9 +1154,9 @@ class ExpressionTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled meta.create_all() test_table.insert().execute({ - 'id':1, - 'data':'somedata', - 'atimestamp':datetime.date(2007, 10, 15), + 'id':1, + 'data':'somedata', + 'atimestamp':datetime.date(2007, 10, 15), 'avalue':25, 'bvalue':'foo'}) @classmethod @@ -1180,7 +1180,7 @@ class ExpressionTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled eq_( testing.db.execute( select([test_table.c.id, test_table.c.data, test_table.c.atimestamp]) - .where(expr), + .where(expr), {"thedate":datetime.date(2007, 10, 15)}).fetchall(), [(1, 'somedata', datetime.date(2007, 10, 15))] ) @@ -1199,9 +1199,9 @@ class ExpressionTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled eq_(expr.right.type._type_affinity, String) eq_( - testing.db.execute(test_table.select().where(expr), + testing.db.execute(test_table.select().where(expr), {"somevalue":"foo"}).fetchall(), - [(1, 'somedata', + [(1, 'somedata', datetime.date(2007, 10, 15), 25, 'BIND_INfooBIND_OUT')] ) @@ -1358,7 +1358,7 @@ class ExpressionTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled def test_null_comparison(self): eq_( - str(column('a', types.NullType()) + column('b', types.NullType())), + str(column('a', types.NullType()) + column('b', types.NullType())), "a + b" ) @@ -1577,7 +1577,7 @@ class NumericTest(fixtures.TestBase): self._do_test( Numeric(precision=8, scale=4), [15.7563, decimal.Decimal("15.7563"), None], - [decimal.Decimal("15.7563"), None], + [decimal.Decimal("15.7563"), None], ) def test_numeric_as_float(self): @@ -1597,7 +1597,7 @@ class NumericTest(fixtures.TestBase): self._do_test( Float(precision=8, asdecimal=True), [15.7563, decimal.Decimal("15.7563"), None], - [decimal.Decimal("15.7563"), None], + [decimal.Decimal("15.7563"), None], filter_ = lambda n:n is not None and round(n, 5) or None ) @@ -1613,8 +1613,8 @@ class NumericTest(fixtures.TestBase): def test_precision_decimal(self): numbers = set([ decimal.Decimal("54.234246451650"), - decimal.Decimal("0.004354"), - decimal.Decimal("900.0"), + decimal.Decimal("0.004354"), + decimal.Decimal("900.0"), ]) self._do_test( @@ -1627,7 +1627,7 @@ class NumericTest(fixtures.TestBase): def test_enotation_decimal(self): """test exceedingly small decimals. - Decimal reports values with E notation when the exponent + Decimal reports values with E notation when the exponent is greater than 6. """ @@ -1652,7 +1652,7 @@ class NumericTest(fixtures.TestBase): numbers ) - @testing.fails_on("sybase+pyodbc", + @testing.fails_on("sybase+pyodbc", "Don't know how do get these values through FreeTDS + Sybase") @testing.fails_on("firebird", "Precision must be from 1 to 18") def test_enotation_decimal_large(self): @@ -1692,7 +1692,7 @@ class NumericTest(fixtures.TestBase): "this may be a bug due to the difficulty in handling " "oracle precision numerics" ) - @testing.fails_on('postgresql+pg8000', + @testing.fails_on('postgresql+pg8000', "pg-8000 does native decimal but truncates the decimals.") def test_numeric_no_decimal(self): numbers = set([ @@ -1794,8 +1794,8 @@ class IntervalTest(fixtures.TestBase, AssertsExecutionResults): small_delta = datetime.timedelta(days=15, seconds=5874) delta = datetime.timedelta(414) interval_table.insert().execute( - native_interval=small_delta, - native_interval_args=delta, + native_interval=small_delta, + native_interval_args=delta, non_native_interval=delta ) row = interval_table.select().execute().first() @@ -1851,22 +1851,22 @@ class BooleanTest(fixtures.TestBase, AssertsExecutionResults): res3 = select([bool_table.c.id, bool_table.c.value]).\ order_by(bool_table.c.id).\ execute().fetchall() - eq_(res3, [(1, True), (2, False), - (3, True), (4, True), + eq_(res3, [(1, True), (2, False), + (3, True), (4, True), (5, True), (6, None)]) # ensure we're getting True/False, not just ints assert res3[0][1] is True assert res3[1][1] is False - @testing.fails_on('mysql', + @testing.fails_on('mysql', "The CHECK clause is parsed but ignored by all storage engines.") - @testing.fails_on('mssql', + @testing.fails_on('mssql', "FIXME: MS-SQL 2005 doesn't honor CHECK ?!?") @testing.skip_if(lambda: testing.db.dialect.supports_native_boolean) def test_constraint(self): assert_raises((exc.IntegrityError, exc.ProgrammingError), - testing.db.execute, + testing.db.execute, "insert into booltest (id, value) values(1, 5)") @testing.skip_if(lambda: testing.db.dialect.supports_native_boolean) @@ -1885,7 +1885,7 @@ class PickleTest(fixtures.TestBase): ): assert p1.compare_values(p1.copy_value(obj), obj) - assert_raises(NotImplementedError, + assert_raises(NotImplementedError, p1.compare_values, pickleable.BrokenComparable('foo'), pickleable.BrokenComparable('foo')) diff --git a/test/sql/test_unicode.py b/test/sql/test_unicode.py index 19f672f77..e3fa0a4b3 100644 --- a/test/sql/test_unicode.py +++ b/test/sql/test_unicode.py @@ -130,7 +130,7 @@ class EscapesDefaultsTest(fixtures.TestBase): select([column(u'special_col')]).select_from(t1).execute().close() assert isinstance(engine.dialect.identifier_preparer.format_sequence(Sequence('special_col')), unicode) - # now execute, run the sequence. it should run in u"Special_col.nextid" or similar as + # now execute, run the sequence. it should run in u"Special_col.nextid" or similar as # a unicode object; cx_oracle asserts that this is None or a String (postgresql lets it pass thru). # ensure that executioncontext._exec_default() is encoding. t1.insert().execute(data='foo') diff --git a/test/sql/test_update.py b/test/sql/test_update.py index f900a164c..79079e512 100644 --- a/test/sql/test_update.py +++ b/test/sql/test_update.py @@ -11,13 +11,13 @@ class _UpdateFromTestBase(object): @classmethod def define_tables(cls, metadata): Table('users', metadata, - Column('id', Integer, primary_key=True, + Column('id', Integer, primary_key=True, test_needs_autoincrement=True), Column('name', String(30), nullable=False), ) Table('addresses', metadata, - Column('id', Integer, primary_key=True, + Column('id', Integer, primary_key=True, test_needs_autoincrement=True), Column('user_id', None, ForeignKey('users.id')), Column('name', String(30), nullable=False), @@ -25,7 +25,7 @@ class _UpdateFromTestBase(object): ) Table("dingalings", metadata, - Column('id', Integer, primary_key=True, + Column('id', Integer, primary_key=True, test_needs_autoincrement=True), Column('address_id', None, ForeignKey('addresses.id')), Column('data', String(30)), @@ -93,7 +93,7 @@ class UpdateFromCompileTest(_UpdateFromTestBase, fixtures.TablesTest, AssertsCom "AND addresses.email_address = :email_address_1 " "AND addresses.id = dingalings.address_id AND " "dingalings.id = :id_1", - checkparams={u'email_address_1': 'e1', u'id_1': 2, + checkparams={u'email_address_1': 'e1', u'id_1': 2, 'name': 'newname'} ) @@ -113,8 +113,8 @@ class UpdateFromCompileTest(_UpdateFromTestBase, fixtures.TablesTest, AssertsCom def test_render_subquery(self): users, addresses = self.tables.users, self.tables.addresses - subq = select([addresses.c.id, - addresses.c.user_id, + subq = select([addresses.c.id, + addresses.c.user_id, addresses.c.email_address]).\ where(addresses.c.id==7).alias() self.assert_compile( @@ -128,7 +128,7 @@ class UpdateFromCompileTest(_UpdateFromTestBase, fixtures.TablesTest, AssertsCom "email_address FROM addresses WHERE addresses.id = " ":id_1) AS anon_1 WHERE users.id = anon_1.user_id " "AND anon_1.email_address = :email_address_1", - checkparams={u'email_address_1': 'e1', + checkparams={u'email_address_1': 'e1', u'id_1': 7, 'name': 'newname'} ) @@ -214,7 +214,7 @@ class UpdateFromRoundTripTest(_UpdateFromTestBase, fixtures.TablesTest): testing.db.execute( addresses.update().\ values({ - addresses.c.email_address:users.c.name, + addresses.c.email_address:users.c.name, users.c.name:'ed2' }).\ where(users.c.id==addresses.c.user_id).\ @@ -246,14 +246,14 @@ class UpdateFromMultiTableUpdateDefaultsTest(_UpdateFromTestBase, fixtures.Table @classmethod def define_tables(cls, metadata): Table('users', metadata, - Column('id', Integer, primary_key=True, + Column('id', Integer, primary_key=True, test_needs_autoincrement=True), Column('name', String(30), nullable=False), Column('some_update', String(30), onupdate="im the update") ) Table('addresses', metadata, - Column('id', Integer, primary_key=True, + Column('id', Integer, primary_key=True, test_needs_autoincrement=True), Column('user_id', None, ForeignKey('users.id')), Column('email_address', String(50), nullable=False), @@ -282,7 +282,7 @@ class UpdateFromMultiTableUpdateDefaultsTest(_UpdateFromTestBase, fixtures.Table ret = testing.db.execute( addresses.update().\ values({ - addresses.c.email_address:users.c.name, + addresses.c.email_address:users.c.name, users.c.name:'ed2' }).\ where(users.c.id==addresses.c.user_id).\ @@ -316,7 +316,7 @@ class UpdateFromMultiTableUpdateDefaultsTest(_UpdateFromTestBase, fixtures.Table ret = testing.db.execute( addresses.update().\ values({ - 'email_address':users.c.name, + 'email_address':users.c.name, }).\ where(users.c.id==addresses.c.user_id).\ where(users.c.name=='ed') @@ -333,7 +333,7 @@ class UpdateFromMultiTableUpdateDefaultsTest(_UpdateFromTestBase, fixtures.Table (4, 9, "fred@fred.com") ] ) - # users table not actually updated, + # users table not actually updated, # so no onupdate eq_( testing.db.execute( |
