diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-08-06 21:11:27 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-08-06 21:11:27 +0000 |
| commit | 8fc5005dfe3eb66a46470ad8a8c7b95fc4d6bdca (patch) | |
| tree | ae9e27d12c9fbf8297bb90469509e1cb6a206242 /test/orm/test_generative.py | |
| parent | 7638aa7f242c6ea3d743aa9100e32be2052546a6 (diff) | |
| download | sqlalchemy-8fc5005dfe3eb66a46470ad8a8c7b95fc4d6bdca.tar.gz | |
merge 0.6 series to trunk.
Diffstat (limited to 'test/orm/test_generative.py')
| -rw-r--r-- | test/orm/test_generative.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/test/orm/test_generative.py b/test/orm/test_generative.py index 0efc1814e..8f61d4d14 100644 --- a/test/orm/test_generative.py +++ b/test/orm/test_generative.py @@ -70,12 +70,17 @@ class GenerativeQueryTest(_base.MappedTest): assert sess.query(func.min(foo.c.bar)).filter(foo.c.bar<30).one() == (0,) assert sess.query(func.max(foo.c.bar)).filter(foo.c.bar<30).one() == (29,) + # Py3K + #assert query.filter(foo.c.bar<30).values(sa.func.max(foo.c.bar)).__next__()[0] == 29 + #assert query.filter(foo.c.bar<30).values(sa.func.max(foo.c.bar)).__next__()[0] == 29 + # Py2K assert query.filter(foo.c.bar<30).values(sa.func.max(foo.c.bar)).next()[0] == 29 assert query.filter(foo.c.bar<30).values(sa.func.max(foo.c.bar)).next()[0] == 29 - + # end Py2K + @testing.resolve_artifact_names def test_aggregate_1(self): - if (testing.against('mysql') and + if (testing.against('mysql') and not testing.against('+zxjdbc') and testing.db.dialect.dbapi.version_info[:4] == (1, 2, 1, 'gamma')): return @@ -95,10 +100,18 @@ class GenerativeQueryTest(_base.MappedTest): def test_aggregate_3(self): query = create_session().query(Foo) + # Py3K + #avg_f = query.filter(foo.c.bar<30).values(sa.func.avg(foo.c.bar)).__next__()[0] + # Py2K avg_f = query.filter(foo.c.bar<30).values(sa.func.avg(foo.c.bar)).next()[0] + # end Py2K assert round(avg_f, 1) == 14.5 + # Py3K + #avg_o = query.filter(foo.c.bar<30).values(sa.func.avg(foo.c.bar)).__next__()[0] + # Py2K avg_o = query.filter(foo.c.bar<30).values(sa.func.avg(foo.c.bar)).next()[0] + # end Py2K assert round(avg_o, 1) == 14.5 @testing.resolve_artifact_names |
