diff options
| author | Brad Allen <bradallen137@gmail.com> | 2010-03-17 16:11:45 -0600 |
|---|---|---|
| committer | Brad Allen <bradallen137@gmail.com> | 2010-03-17 16:11:45 -0600 |
| commit | 75e7b1081c2c8412dda822465ca3b395eca57f6f (patch) | |
| tree | 07cd0b56e6dd5e35f28edba9b02d9d6121d417dd /test/sql/test_query.py | |
| parent | e6a7f1ce0c5f365997f3d856eeb0259528967c03 (diff) | |
| parent | 95c0214356a55b6bc051d2b779e54d6de7b0b22e (diff) | |
| download | sqlalchemy-75e7b1081c2c8412dda822465ca3b395eca57f6f.tar.gz | |
merged from main tip
Diffstat (limited to 'test/sql/test_query.py')
| -rw-r--r-- | test/sql/test_query.py | 54 |
1 files changed, 22 insertions, 32 deletions
diff --git a/test/sql/test_query.py b/test/sql/test_query.py index 7685d0985..96d0567a3 100644 --- a/test/sql/test_query.py +++ b/test/sql/test_query.py @@ -818,14 +818,14 @@ class QueryTest(TestBase): assert len(r) == 3 - @testing.emits_warning('.*empty sequence.*') - @testing.fails_on('firebird', 'FIXME: unknown') - @testing.fails_on('maxdb', 'FIXME: unknown') - @testing.fails_on('oracle', 'FIXME: unknown') - @testing.fails_on('mssql', 'FIXME: unknown') + @testing.requires.boolean_col_expressions def test_in_filtering_advanced(self): - """test the behavior of the in_() function when comparing against an empty collection.""" + """test the behavior of the in_() function when + comparing against an empty collection, specifically + that a proper boolean value is generated. + + """ users.insert().execute(user_id = 7, user_name = 'jack') users.insert().execute(user_id = 8, user_name = 'fred') @@ -978,6 +978,7 @@ class LimitTest(TestBase): r = users.select(limit=3, order_by=[users.c.user_id]).execute().fetchall() self.assert_(r == [(1, 'john'), (2, 'jack'), (3, 'ed')], repr(r)) + @testing.requires.offset @testing.fails_on('maxdb', 'FIXME: unknown') def test_select_limit_offset(self): """Test the interaction between limit and offset""" @@ -994,6 +995,7 @@ class LimitTest(TestBase): self.assert_(len(r) == 3, repr(r)) self.assert_(r[0] != r[1] and r[1] != r[2], repr(r)) + @testing.requires.offset @testing.fails_on('mssql', 'FIXME: unknown') def test_select_distinct_offset(self): """Test the interaction between distinct and offset""" @@ -1002,6 +1004,7 @@ class LimitTest(TestBase): self.assert_(len(r) == 4, repr(r)) self.assert_(r[0] != r[1] and r[1] != r[2] and r[2] != [3], repr(r)) + @testing.requires.offset def test_select_distinct_limit_offset(self): """Test the interaction between limit and limit/offset""" @@ -1170,9 +1173,7 @@ class CompoundTest(TestBase): found2 = self._fetchall_sorted(e.alias('foo').select().execute()) eq_(found2, wanted) - @testing.crashes('firebird', 'Does not support intersect') - @testing.crashes('sybase', 'FIXME: unknown, verify not fails_on') - @testing.fails_on('mysql', 'FIXME: unknown') + @testing.requires.intersect def test_intersect(self): i = intersect( select([t2.c.col3, t2.c.col4]), @@ -1187,9 +1188,7 @@ class CompoundTest(TestBase): found2 = self._fetchall_sorted(i.alias('bar').select().execute()) eq_(found2, wanted) - @testing.crashes('firebird', 'Does not support except') - @testing.crashes('sybase', 'FIXME: unknown, verify not fails_on') - @testing.fails_on('mysql', 'FIXME: unknown') + @testing.requires.except_ @testing.fails_on('sqlite', "Can't handle this style of nesting") def test_except_style1(self): e = except_(union( @@ -1204,9 +1203,7 @@ class CompoundTest(TestBase): found = self._fetchall_sorted(e.alias().select().execute()) eq_(found, wanted) - @testing.crashes('firebird', 'Does not support except') - @testing.crashes('sybase', 'FIXME: unknown, verify not fails_on') - @testing.fails_on('mysql', 'FIXME: unknown') + @testing.requires.except_ def test_except_style2(self): # same as style1, but add alias().select() to the except_(). # sqlite can handle it now. @@ -1226,10 +1223,8 @@ class CompoundTest(TestBase): found2 = self._fetchall_sorted(e.alias().select().execute()) eq_(found2, wanted) - @testing.crashes('firebird', 'Does not support except') - @testing.crashes('sybase', 'FIXME: unknown, verify not fails_on') - @testing.fails_on('mysql', 'FIXME: unknown') @testing.fails_on('sqlite', "Can't handle this style of nesting") + @testing.requires.except_ def test_except_style3(self): # aaa, bbb, ccc - (aaa, bbb, ccc - (ccc)) = ccc e = except_( @@ -1243,9 +1238,7 @@ class CompoundTest(TestBase): eq_(e.alias('foo').select().execute().fetchall(), [('ccc',)]) - @testing.crashes('firebird', 'Does not support except') - @testing.crashes('sybase', 'FIXME: unknown, verify not fails_on') - @testing.fails_on('mysql', 'FIXME: unknown') + @testing.requires.except_ def test_except_style4(self): # aaa, bbb, ccc - (aaa, bbb, ccc - (ccc)) = ccc e = except_( @@ -1262,8 +1255,7 @@ class CompoundTest(TestBase): [('ccc',)] ) - @testing.crashes('firebird', 'Does not support intersect') - @testing.fails_on('mysql', 'FIXME: unknown') + @testing.requires.intersect @testing.fails_on('sqlite', "sqlite can't handle leading parenthesis") def test_intersect_unions(self): u = intersect( @@ -1281,8 +1273,7 @@ class CompoundTest(TestBase): eq_(found, wanted) - @testing.crashes('firebird', 'Does not support intersect') - @testing.fails_on('mysql', 'FIXME: unknown') + @testing.requires.intersect def test_intersect_unions_2(self): u = intersect( union( @@ -1299,9 +1290,8 @@ class CompoundTest(TestBase): eq_(found, wanted) - @testing.crashes('firebird', 'Does not support intersect') - @testing.fails_on('mysql', 'FIXME: unknown') - def test_intersect(self): + @testing.requires.intersect + def test_intersect_unions_3(self): u = intersect( select([t2.c.col3, t2.c.col4]), union( @@ -1315,8 +1305,7 @@ class CompoundTest(TestBase): eq_(found, wanted) - @testing.crashes('firebird', 'Does not support intersect') - @testing.fails_on('mysql', 'FIXME: unknown') + @testing.requires.intersect def test_composite_alias(self): ua = intersect( select([t2.c.col3, t2.c.col4]), @@ -1610,7 +1599,7 @@ class OperatorTest(TestBase): global metadata, flds metadata = MetaData(testing.db) flds = Table('flds', metadata, - Column('idcol', Integer, Sequence('t1pkseq'), primary_key=True), + Column('idcol', Integer, primary_key=True, test_needs_autoincrement=True), Column('intcol', Integer), Column('strcol', String(50)), ) @@ -1624,11 +1613,12 @@ class OperatorTest(TestBase): @classmethod def teardown_class(cls): metadata.drop_all() + + # TODO: seems like more tests warranted for this setup. @testing.crashes('mssql+mxodbc', """Invalid bind parameter placement: 'SELECT flds.intcol % ? AS anon_1 \nFROM flds ORDER BY flds.idcol' (3,) """) - @testing.fails_on('maxdb', 'FIXME: unknown') def test_modulo(self): eq_( select([flds.c.intcol % 3], |
