diff options
| author | Michael Trier <mtrier@gmail.com> | 2008-12-12 03:41:05 +0000 |
|---|---|---|
| committer | Michael Trier <mtrier@gmail.com> | 2008-12-12 03:41:05 +0000 |
| commit | 1d90146210b0919294a99468a916d4084fc14c7d (patch) | |
| tree | 75bf422e326289f225adc399675d9a316486878a /test/sql | |
| parent | aaac4520d3a4d1b2b73403bedaeb67d9cf26409c (diff) | |
| download | sqlalchemy-1d90146210b0919294a99468a916d4084fc14c7d.tar.gz | |
Modified fails_on testing decorator to take a reason for the failure.
This should assist with helping to document the reasons for testing failures.
Currently unspecified failures are defaulted to 'FIXME: unknown'.
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/case_statement.py | 6 | ||||
| -rw-r--r-- | test/sql/constraints.py | 2 | ||||
| -rw-r--r-- | test/sql/defaults.py | 26 | ||||
| -rw-r--r-- | test/sql/query.py | 36 | ||||
| -rw-r--r-- | test/sql/testtypes.py | 9 |
5 files changed, 43 insertions, 36 deletions
diff --git a/test/sql/case_statement.py b/test/sql/case_statement.py index 4d017a977..1d5383749 100644 --- a/test/sql/case_statement.py +++ b/test/sql/case_statement.py @@ -27,7 +27,8 @@ class CaseTest(TestBase, AssertsCompiledSQL): def tearDownAll(self): info_table.drop() - @testing.fails_on('firebird', 'maxdb') + @testing.fails_on('firebird', 'FIXME: unknown') + @testing.fails_on('maxdb', 'FIXME: unknown') @testing.requires.subqueries def testcase(self): inner = select([case([ @@ -98,7 +99,8 @@ class CaseTest(TestBase, AssertsCompiledSQL): self.assert_compile(case([(t.c.col1==7, "y")], else_="z"), "CASE WHEN (test.col1 = :col1_1) THEN :param_1 ELSE :param_2 END") - @testing.fails_on('firebird', 'maxdb') + @testing.fails_on('firebird', 'FIXME: unknown') + @testing.fails_on('maxdb', 'FIXME: unknown') def testcase_with_dict(self): query = select([case({ info_table.c.pk < 3: 'lessthan3', diff --git a/test/sql/constraints.py b/test/sql/constraints.py index ab08c6d98..c9b52da7c 100644 --- a/test/sql/constraints.py +++ b/test/sql/constraints.py @@ -63,7 +63,7 @@ class ConstraintTest(TestBase, AssertsExecutionResults): ) metadata.create_all() - @testing.fails_on('mysql') + @testing.fails_on('mysql', 'FIXME: unknown') def test_check_constraint(self): foo = Table('foo', metadata, Column('id', Integer, primary_key=True), diff --git a/test/sql/defaults.py b/test/sql/defaults.py index de939f08d..bea6dc04b 100644 --- a/test/sql/defaults.py +++ b/test/sql/defaults.py @@ -167,7 +167,7 @@ class DefaultTest(testing.TestBase): for fn in fn1, fn2, fn3, fn4, fn5, fn6, fn7, fn8: c = sa.ColumnDefault(fn) - @testing.fails_on('firebird') # 'Data type unknown' + @testing.fails_on('firebird', 'Data type unknown') def test_standalone(self): c = testing.db.engine.contextual_connect() x = c.execute(t.c.col1.default) @@ -246,7 +246,7 @@ class DefaultTest(testing.TestBase): has_('col7', 'default', 'server_default', 'onupdate') has_('col8', 'default', 'server_default', 'onupdate', 'server_onupdate') - @testing.fails_on('firebird') # 'Data type unknown' + @testing.fails_on('firebird', 'Data type unknown') def test_insert(self): r = t.insert().execute() assert r.lastrow_has_defaults() @@ -277,7 +277,7 @@ class DefaultTest(testing.TestBase): [(54, 'imthedefault', f, ts, ts, ctexec, True, False, 12, today, None)]) - @testing.fails_on('firebird') # 'Data type unknown' + @testing.fails_on('firebird', 'Data type unknown') def test_insertmany(self): # MySQL-Python 1.2.2 breaks functions in execute_many :( if (testing.against('mysql') and @@ -302,7 +302,7 @@ class DefaultTest(testing.TestBase): l = t.select().execute() eq_(50, l.fetchone()['col3']) - @testing.fails_on('firebird') # 'Data type unknown' + @testing.fails_on('firebird', 'Data type unknown') def test_updatemany(self): # MySQL-Python 1.2.2 breaks functions in execute_many :( if (testing.against('mysql') and @@ -330,7 +330,7 @@ class DefaultTest(testing.TestBase): (53, 'im the update', f2, ts, ts, ctexec, True, False, 13, today, 'py')]) - @testing.fails_on('firebird') # 'Data type unknown' + @testing.fails_on('firebird', 'Data type unknown') def test_update(self): r = t.insert().execute() pk = r.last_inserted_ids()[0] @@ -343,7 +343,7 @@ class DefaultTest(testing.TestBase): 13, datetime.date.today(), 'py')) eq_(11, f2) - @testing.fails_on('firebird') # 'Data type unknown' + @testing.fails_on('firebird', 'Data type unknown') def test_update_values(self): r = t.insert().execute() pk = r.last_inserted_ids()[0] @@ -396,7 +396,7 @@ class PKDefaultTest(_base.TablesTest): default=sa.select([func.max(t2.c.nextid)]).as_scalar()), Column('data', String(30))) - @testing.fails_on('mssql') + @testing.fails_on('mssql', 'FIXME: unknown') @testing.resolve_artifact_names def test_basic(self): t2.insert().execute(nextid=1) @@ -419,7 +419,7 @@ class PKIncrementTest(_base.TablesTest): Column('str1', String(20))) # TODO: add coverage for increment on a secondary column in a key - @testing.fails_on('firebird') # data type unknown + @testing.fails_on('firebird', 'Data type unknown') @testing.resolve_artifact_names def _test_autoincrement(self, bind): ids = set() @@ -475,7 +475,7 @@ class PKIncrementTest(_base.TablesTest): class EmptyInsertTest(testing.TestBase): @testing.exclude('sqlite', '<', (3, 3, 8), 'no empty insert support') - @testing.fails_on('oracle') + @testing.fails_on('oracle', 'FIXME: unknown') def test_empty_insert(self): metadata = MetaData(testing.db) t1 = Table('t1', metadata, @@ -518,7 +518,7 @@ class AutoIncrementTest(_base.TablesTest): id_ = r.last_inserted_ids()[0] nodes.insert().execute(data='bar', parent_id=id_) - @testing.fails_on('sqlite') + @testing.fails_on('sqlite', 'FIXME: unknown') def test_non_autoincrement(self): # sqlite INT primary keys can be non-unique! (only for ints) nonai = Table("nonaitest", self.metadata, @@ -592,7 +592,7 @@ class SequenceTest(testing.TestBase): cartitems.select().execute().fetchall() - @testing.fails_on('maxdb') + @testing.fails_on('maxdb', 'FIXME: unknown') # maxdb db-api seems to double-execute NEXTVAL internally somewhere, # throwing off the numbers for these tests... def test_implicit_sequence_exec(self): @@ -604,7 +604,7 @@ class SequenceTest(testing.TestBase): finally: s.drop() - @testing.fails_on('maxdb') + @testing.fails_on('maxdb', 'FIXME: unknown') def teststandalone_explicit(self): s = Sequence("my_sequence") s.create(bind=testing.db) @@ -621,7 +621,7 @@ class SequenceTest(testing.TestBase): s.drop(testing.db, checkfirst=False) s.drop(testing.db, checkfirst=True) - @testing.fails_on('maxdb') + @testing.fails_on('maxdb', 'FIXME: unknown') def teststandalone2(self): x = cartitems.c.cart_id.sequence.execute() self.assert_(1 <= x <= 4) diff --git a/test/sql/query.py b/test/sql/query.py index 011ced602..86ad02aa4 100644 --- a/test/sql/query.py +++ b/test/sql/query.py @@ -140,7 +140,7 @@ class QueryTest(TestBase): l.append(row) self.assert_(len(l) == 3) - @testing.fails_on('firebird') # Data type unknown + @testing.fails_on('firebird', 'Data type unknown') @testing.requires.subqueries def test_anonymous_rows(self): users.insert().execute( @@ -200,7 +200,8 @@ class QueryTest(TestBase): self.assert_(not (rp != equal)) self.assert_(not (equal != equal)) - @testing.fails_on('mssql', 'oracle') + @testing.fails_on('mssql', 'No support for boolean logic in column select.') + @testing.fails_on('oracle', 'FIXME: unknown') def test_or_and_as_columns(self): true, false = literal(True), literal(False) @@ -590,7 +591,10 @@ class QueryTest(TestBase): r = s.execute(search_key=None).fetchall() assert len(r) == 0 - @testing.fails_on('firebird', 'maxdb', 'oracle', 'mssql') + @testing.fails_on('firebird', 'FIXME: unknown') + @testing.fails_on('maxdb', 'FIXME: unknown') + @testing.fails_on('oracle', 'FIXME: unknown') + @testing.fails_on('mssql', 'FIXME: unknown') def test_in_filtering_advanced(self): """test the behavior of the in_() function when comparing against an empty collection.""" @@ -648,7 +652,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.fails_on('maxdb') + @testing.fails_on('maxdb', 'FIXME: unknown') def test_select_limit_offset(self): """Test the interaction between limit and offset""" @@ -664,7 +668,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.fails_on('mssql') + @testing.fails_on('mssql', 'FIXME: unknown') def test_select_distinct_offset(self): """Test the interaction between distinct and offset""" @@ -756,7 +760,7 @@ class CompoundTest(TestBase): ('ccc', 'aaa')] self.assertEquals(u.execute().fetchall(), wanted) - @testing.fails_on('maxdb') + @testing.fails_on('maxdb', 'FIXME: unknown') @testing.requires.subqueries def test_union_ordered_alias(self): (s1, s2) = ( @@ -772,8 +776,8 @@ class CompoundTest(TestBase): self.assertEquals(u.alias('bar').select().execute().fetchall(), wanted) @testing.crashes('oracle', 'FIXME: unknown, verify not fails_on') - @testing.fails_on('mysql') - @testing.fails_on('sqlite') + @testing.fails_on('mysql', 'FIXME: unknown') + @testing.fails_on('sqlite', 'FIXME: unknown') def test_union_all(self): e = union_all( select([t1.c.col3]), @@ -792,7 +796,7 @@ class CompoundTest(TestBase): @testing.crashes('firebird', 'Does not support intersect') @testing.crashes('sybase', 'FIXME: unknown, verify not fails_on') - @testing.fails_on('mysql') + @testing.fails_on('mysql', 'FIXME: unknown') def test_intersect(self): i = intersect( select([t2.c.col3, t2.c.col4]), @@ -810,7 +814,7 @@ class CompoundTest(TestBase): @testing.crashes('firebird', 'Does not support except') @testing.crashes('oracle', 'FIXME: unknown, verify not fails_on') @testing.crashes('sybase', 'FIXME: unknown, verify not fails_on') - @testing.fails_on('mysql') + @testing.fails_on('mysql', 'FIXME: unknown') def test_except_style1(self): e = except_(union( select([t1.c.col3, t1.c.col4]), @@ -827,7 +831,7 @@ class CompoundTest(TestBase): @testing.crashes('firebird', 'Does not support except') @testing.crashes('oracle', 'FIXME: unknown, verify not fails_on') @testing.crashes('sybase', 'FIXME: unknown, verify not fails_on') - @testing.fails_on('mysql') + @testing.fails_on('mysql', 'FIXME: unknown') def test_except_style2(self): e = except_(union( select([t1.c.col3, t1.c.col4]), @@ -847,8 +851,8 @@ class CompoundTest(TestBase): @testing.crashes('firebird', 'Does not support except') @testing.crashes('oracle', 'FIXME: unknown, verify not fails_on') @testing.crashes('sybase', 'FIXME: unknown, verify not fails_on') - @testing.fails_on('mysql') - @testing.fails_on('sqlite') + @testing.fails_on('mysql', 'FIXME: unknown') + @testing.fails_on('sqlite', 'FIXME: unknown') def test_except_style3(self): # aaa, bbb, ccc - (aaa, bbb, ccc - (ccc)) = ccc e = except_( @@ -863,7 +867,7 @@ class CompoundTest(TestBase): [('ccc',)]) @testing.crashes('firebird', 'Does not support intersect') - @testing.fails_on('mysql') + @testing.fails_on('mysql', 'FIXME: unknown') def test_composite(self): u = intersect( select([t2.c.col3, t2.c.col4]), @@ -879,7 +883,7 @@ class CompoundTest(TestBase): self.assertEquals(found, wanted) @testing.crashes('firebird', 'Does not support intersect') - @testing.fails_on('mysql') + @testing.fails_on('mysql', 'FIXME: unknown') def test_composite_alias(self): ua = intersect( select([t2.c.col3, t2.c.col4]), @@ -1184,7 +1188,7 @@ class OperatorTest(TestBase): def tearDownAll(self): metadata.drop_all() - @testing.fails_on('maxdb') + @testing.fails_on('maxdb', 'FIXME: unknown') def test_modulo(self): self.assertEquals( select([flds.c.intcol % 3], diff --git a/test/sql/testtypes.py b/test/sql/testtypes.py index e66ff6b11..02eebf631 100644 --- a/test/sql/testtypes.py +++ b/test/sql/testtypes.py @@ -344,7 +344,7 @@ class UnicodeTest(TestBase, AssertsExecutionResults): finally: unicode_engine.dispose() - @testing.fails_on('oracle') + @testing.fails_on('oracle', 'FIXME: unknown') def test_blank_strings(self): unicode_table.insert().execute(unicode_varchar=u'') assert select([unicode_table.c.unicode_varchar]).scalar() == u'' @@ -374,7 +374,7 @@ class UnicodeTest(TestBase, AssertsExecutionResults): testing.db.engine.dialect.convert_unicode = prev_assert @testing.crashes('oracle', 'FIXME: unknown, verify not fails_on') - @testing.fails_on('firebird') # "Data type unknown" on the parameter + @testing.fails_on('firebird', 'Data type unknown') def test_length_function(self): """checks the database correctly understands the length of a unicode string""" teststr = u'aaa\x1234' @@ -498,7 +498,7 @@ class ExpressionTest(TestBase, AssertsExecutionResults): assert expr.right.type.__class__ == test_table.c.avalue.type.__class__ assert testing.db.execute(test_table.select().where(expr), {"somevalue":25}).fetchall() == [(1, 'somedata', datetime.date(2007, 10, 15), 25)] - @testing.fails_on('firebird') # "Data type unknown" on the parameter + @testing.fails_on('firebird', 'Data type unknown on the parameter') def test_operator_adapt(self): """test type-based overloading of operators""" @@ -657,7 +657,8 @@ class DateTest(TestBase, AssertsExecutionResults): t.drop(checkfirst=True) class StringTest(TestBase, AssertsExecutionResults): - @testing.fails_on('mysql', 'oracle') + @testing.fails_on('mysql', 'FIXME: unknown') + @testing.fails_on('oracle', 'FIXME: unknown') def test_nolength_string(self): metadata = MetaData(testing.db) foo = Table('foo', metadata, Column('one', String)) |
