diff options
| author | Jason Kirtland <jek@discorporate.us> | 2008-01-22 19:42:12 +0000 |
|---|---|---|
| committer | Jason Kirtland <jek@discorporate.us> | 2008-01-22 19:42:12 +0000 |
| commit | 5bc0fe9e16e94dd2ed16b7bf393cef0b9a4ceb25 (patch) | |
| tree | 76ae4e8953908ff01e6ead4a19a239860436fd3a | |
| parent | 342adac63723ec93cc1595e29d087a670186f4a2 (diff) | |
| download | sqlalchemy-5bc0fe9e16e94dd2ed16b7bf393cef0b9a4ceb25.tar.gz | |
- Removed some test bogosity
| -rw-r--r-- | test/orm/generative.py | 21 |
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) |
