From: Mike Bayer Date: Tue, 1 Apr 2008 17:46:36 +0000 (+0000) Subject: fix up some unit tests X-Git-Tag: rel_0_4_5~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ae89c28f0c4e86a2325ba857ec7dd1e2a5cd3c9;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fix up some unit tests --- diff --git a/test/dialect/mssql.py b/test/dialect/mssql.py index c5ba627180..2adbca6b8f 100755 --- a/test/dialect/mssql.py +++ b/test/dialect/mssql.py @@ -59,7 +59,7 @@ class CompileTest(TestBase, AssertsCompiledSQL): def test_delete_schema(self): metadata = MetaData() tbl = Table('test', metadata, Column('id', Integer, primary_key=True), schema='paj') - self.assert_compile(tbl.delete(tbl.c.id == 1), "DELETE FROM paj.test WHERE paj.test.id = :test_id_1") + self.assert_compile(tbl.delete(tbl.c.id == 1), "DELETE FROM paj.test WHERE paj.test.id = :paj_test_id_1") def test_union(self): t1 = table('t1', diff --git a/test/dialect/oracle.py b/test/dialect/oracle.py index e5fb123d25..4b9745a2d2 100644 --- a/test/dialect/oracle.py +++ b/test/dialect/oracle.py @@ -40,7 +40,7 @@ class CompileTest(TestBase, AssertsCompiledSQL): Column('parent_id', Integer, ForeignKey('ed.parent.id')), owner = 'ed') - self.assert_compile(parent.join(child), "ed.parent JOIN ed.child ON parent.id = child.parent_id") + self.assert_compile(parent.join(child), "ed.parent JOIN ed.child ON ed.parent.id = ed.child.parent_id") def test_subquery(self): t = table('sometable', column('col1'), column('col2')) diff --git a/test/orm/memusage.py b/test/orm/memusage.py index 2b3081c6bf..1851639edf 100644 --- a/test/orm/memusage.py +++ b/test/orm/memusage.py @@ -23,13 +23,16 @@ def profile_memory(func): assert len(_sessions) == 0 - # TODO: this test only finds pure "growing" tests + # TODO: this test only finds pure "growing" tests. + # if a drop is detected, it's assumed that GC is able + # to reduce memory. better methodology would + # make this more accurate. for i, x in enumerate(samples): - if i < len(samples) - 1 and samples[i+1] <= x: - break + if i < len(samples) - 1 and x < samples[i+1]: + continue else: - assert False, repr(samples) - assert True + return + assert False, repr(samples) return profile def assert_no_mappers(): diff --git a/test/profiling/compiler.py b/test/profiling/compiler.py index 51ec25e38c..0ce0e7792c 100644 --- a/test/profiling/compiler.py +++ b/test/profiling/compiler.py @@ -24,7 +24,7 @@ class CompileTest(TestBase, AssertsExecutionResults): t1.update().compile() # TODO: this is alittle high - @profiling.function_call_count(125, versions={'2.3': 180}) + @profiling.function_call_count(125, versions={'2.3': 180, '2.4':140}) def test_select(self): s = select([t1], t1.c.c2==t2.c.c1) s.compile()