From: Mike Bayer Date: Thu, 23 Dec 2010 01:36:20 +0000 (-0500) Subject: - allow cextension version to fall back to non-cextension X-Git-Tag: rel_0_7b1~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=015110267e12871ce08c0f3730de0f8488767514;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - allow cextension version to fall back to non-cextension - start taking out "default" version, 2.4 version, only need these tests in a relative sense --- diff --git a/test/aaa_profiling/test_compiler.py b/test/aaa_profiling/test_compiler.py index 5d32ee5812..37fc4fb204 100644 --- a/test/aaa_profiling/test_compiler.py +++ b/test/aaa_profiling/test_compiler.py @@ -32,20 +32,20 @@ class CompileTest(TestBase, AssertsExecutionResults): cls.dialect = default.DefaultDialect() - @profiling.function_call_count(58, {'2.4': 44, + @profiling.function_call_count(versions={'2.7':58, '2.6':58, '3.0':77, '3.1':77}) def test_insert(self): t1.insert().compile(dialect=self.dialect) - @profiling.function_call_count(49, {'2.4': 45}) + @profiling.function_call_count(versions={'2.6':49, '2.7':49}) def test_update(self): t1.update().compile(dialect=self.dialect) - @profiling.function_call_count(110, {'2.4': 81, '3':132}) + @profiling.function_call_count(versions={'2.6':110, '2.7':110, '2.4': 81, '3':132}) def test_update_whereclause(self): t1.update().where(t1.c.c2==12).compile(dialect=self.dialect) - @profiling.function_call_count(148, versions={'2.4':105, + @profiling.function_call_count(versions={'2.4':105, '2.7':148, '2.6':148, '3.0':208, '3.1':208}) def test_select(self): s = select([t1], t1.c.c2==t2.c.c1) diff --git a/test/aaa_profiling/test_resultset.py b/test/aaa_profiling/test_resultset.py index dc4732cb83..51199eb3ad 100644 --- a/test/aaa_profiling/test_resultset.py +++ b/test/aaa_profiling/test_resultset.py @@ -33,7 +33,10 @@ class ResultSetTest(TestBase, AssertsExecutionResults): def teardown(self): metadata.drop_all() - @profiling.function_call_count(14416, versions={'2.4': 13214, + @profiling.function_call_count(versions={ + '2.4': 13214, + '2.6':14416, + '2.7':14416, '2.6+cextension': 345, '2.7+cextension':345}) def test_string(self): @@ -41,7 +44,9 @@ class ResultSetTest(TestBase, AssertsExecutionResults): # sqlite3 returns native unicode. so shouldn't be an increase here. - @profiling.function_call_count(14396, versions={'2.4': 13214, + @profiling.function_call_count(versions={ + '2.7':14396, + '2.6':14396, '2.6+cextension': 345, '2.7+cextension':345}) def test_unicode(self): @@ -57,7 +62,7 @@ class ExecutionTest(TestBase): # ensure initial connect activities complete c.execute("select 1") - @profiling.function_call_count(36, versions={'2.6':35, '2.5':35, + @profiling.function_call_count(versions={'2.7':36, '2.6':35, '2.5':35, '2.4':21, '3':34}, variance=.10) def go(): @@ -70,8 +75,9 @@ class ExecutionTest(TestBase): # ensure initial connect activities complete e.execute("select 1") - @profiling.function_call_count(56, versions={'2.4':41, '2.5':58, + @profiling.function_call_count(versions={'2.4':41, '2.5':58, '2.6':58, '3':57, + '2.7':56, '2.6+cextension':56}, variance=.05) def go(): diff --git a/test/lib/profiling.py b/test/lib/profiling.py index 2b358d5001..441fe931dc 100644 --- a/test/lib/profiling.py +++ b/test/lib/profiling.py @@ -113,14 +113,17 @@ def function_call_count(count=None, versions={}, variance=0.05): cextension = True except ImportError: cextension = False - + while version_info: version = '.'.join([str(v) for v in version_info]) - if cextension: + if cextension and (version + "+cextension") in versions: version += "+cextension" - if version in versions: count = versions[version] break + elif version in versions: + count = versions[version] + break + version_info.pop() if count is None: