summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2008-01-22 19:42:12 +0000
committerJason Kirtland <jek@discorporate.us>2008-01-22 19:42:12 +0000
commit5bc0fe9e16e94dd2ed16b7bf393cef0b9a4ceb25 (patch)
tree76ae4e8953908ff01e6ead4a19a239860436fd3a
parent342adac63723ec93cc1595e29d087a670186f4a2 (diff)
downloadsqlalchemy-5bc0fe9e16e94dd2ed16b7bf393cef0b9a4ceb25.tar.gz
- Removed some test bogosity
-rw-r--r--test/orm/generative.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/test/orm/generative.py b/test/orm/generative.py
index 294117b0d..ee8f10969 100644
--- a/test/orm/generative.py
+++ b/test/orm/generative.py
@@ -70,22 +70,21 @@ class GenerativeQueryTest(PersistTest):
query = create_session(bind=testing.db).query(Foo)
assert query.filter(foo.c.bar<30).sum(foo.c.bar) == 435
- @testing.fails_on('postgres', 'mysql', 'firebird', 'mssql')
+ @testing.fails_on('firebird', 'mssql')
def test_aggregate_2(self):
query = create_session(bind=testing.db).query(Foo)
- assert query.filter(foo.c.bar<30).avg(foo.c.bar) == 14.5
+ avg = query.filter(foo.c.bar < 30).avg(foo.c.bar)
+ assert round(avg, 1) == 14.5
- @testing.fails_on_everything_except('sqlite', 'postgres', 'mysql',
- 'firebird', 'mssql')
- def test_aggregate_2_int(self):
- query = create_session(bind=testing.db).query(Foo)
- assert int(query.filter(foo.c.bar<30).avg(foo.c.bar)) == 14
-
- @testing.fails_on('postgres', 'mysql', 'firebird', 'mssql')
+ @testing.fails_on('firebird', 'mssql')
def test_aggregate_3(self):
query = create_session(bind=testing.db).query(Foo)
- assert query.filter(foo.c.bar<30).apply_avg(foo.c.bar).first() == 14.5
- assert query.filter(foo.c.bar<30).apply_avg(foo.c.bar).one() == 14.5
+
+ avg_f = query.filter(foo.c.bar<30).apply_avg(foo.c.bar).first()
+ assert round(avg_f, 1) == 14.5
+
+ avg_o = query.filter(foo.c.bar<30).apply_avg(foo.c.bar).one()
+ assert round(avg_o, 1) == 14.5
def test_filter(self):
query = create_session(bind=testing.db).query(Foo)