]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- callcounts
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 8 Apr 2011 20:21:09 +0000 (16:21 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 8 Apr 2011 20:21:09 +0000 (16:21 -0400)
- clean out pool._refs in the test_pool perf tests, make things simple

doc/build/core/engines.rst
test/aaa_profiling/test_pool.py
test/aaa_profiling/test_zoomark.py
test/aaa_profiling/test_zoomark_orm.py

index dbc02551055bc781c897445ad05c901afe11d89f..5fef74faf9784a438618a04070228e301fbf0097 100644 (file)
@@ -89,7 +89,7 @@ cx_oracle_                 ``oracle+cx_oracle``\*       yes          development
 **Postgresql**
 pg8000_                    ``postgresql+pg8000``        yes          yes           no           yes                yes
 `PostgreSQL JDBC Driver`_  ``postgresql+zxjdbc``        no           no            yes          yes                yes
-psycopg2_                  ``postgresql+psycopg2``\*    yes          development   no           yes                yes
+psycopg2_                  ``postgresql+psycopg2``\*    yes          yes           no           yes                yes
 pypostgresql_              ``postgresql+pypostgresql``  no           yes           no           yes                yes
 **SQLite**
 pysqlite_                  ``sqlite+pysqlite``\*        yes          yes           no           yes                yes
index 563f8fcb7f76f0ac144e9ed7a4d9f623d234bbd3..35f6b71f930baa736142c0c022eb142014797162 100644 (file)
@@ -1,7 +1,7 @@
 from sqlalchemy import *
 from test.lib import *
 from sqlalchemy.pool import QueuePool
-
+from sqlalchemy import pool as pool_module
 
 class QueuePoolTest(fixtures.TestBase, AssertsExecutionResults):
     class Connection(object):
@@ -11,6 +11,13 @@ class QueuePoolTest(fixtures.TestBase, AssertsExecutionResults):
         def close(self):
             pass
 
+    def teardown(self):
+        # the tests leave some fake connections
+        # around which dont necessarily 
+        # get gc'ed as quickly as we'd like,
+        # on backends like pypy, python3.2
+        pool_module._refs.clear()
+
     def setup(self):
         global pool
         pool = QueuePool(creator=self.Connection,
@@ -20,7 +27,8 @@ class QueuePoolTest(fixtures.TestBase, AssertsExecutionResults):
 
     @profiling.function_call_count(72, {'2.4': 63, '2.7':67, 
                                             '2.7+cextension':67,
-                                            '3.0':73, '3.1':73},
+                                            '3.0':73, '3.1':73, 
+                                            '3.2':55},
                                             variance=.10)
     def test_first_connect(self):
         conn = pool.connect()
@@ -30,6 +38,7 @@ class QueuePoolTest(fixtures.TestBase, AssertsExecutionResults):
         conn.close()
 
         @profiling.function_call_count(32, {'2.4': 21, '2.7':29,
+                                            '3.2':25,
                                             '2.7+cextension':29},
                                             variance=.10)
         def go():
@@ -40,7 +49,7 @@ class QueuePoolTest(fixtures.TestBase, AssertsExecutionResults):
     def test_second_samethread_connect(self):
         conn = pool.connect()
 
-        @profiling.function_call_count(6, {'2.4': 4, '3.0':7, '3.1':7})
+        @profiling.function_call_count(6, {'2.4': 4, '3':7})
         def go():
             return pool.connect()
         c2 = go()
index c448529167e6dfd6905ebbbcf9b69e4a3f063aef..dfea8312a24e7edd8fdf80999f46b5091afdbb23 100644 (file)
@@ -362,7 +362,7 @@ class ZooMarkTest(fixtures.TestBase):
     def test_profile_1_create_tables(self):
         self.test_baseline_1_create_tables()
 
-    @profiling.function_call_count(5045, {'2.6':5099, '2.4': 3650})
+    @profiling.function_call_count(5045, {'2.6':5099, '2.4': 3650, '3.2':4699})
     def test_profile_1a_populate(self):
         self.test_baseline_1a_populate()
 
@@ -387,7 +387,7 @@ class ZooMarkTest(fixtures.TestBase):
     def test_profile_5_aggregates(self):
         self.test_baseline_5_aggregates()
 
-    @profiling.function_call_count(1788, {'2.4': 1118})
+    @profiling.function_call_count(1788, {'2.4': 1118, '3.2':1647})
     def test_profile_6_editing(self):
         self.test_baseline_6_editing()
 
index 2e7273e018956fe65704a273ea3606aec47a358c..592e63701e99bef8b22f98d1a384f094f7630d04 100644 (file)
@@ -338,7 +338,7 @@ class ZooMarkTest(fixtures.TestBase):
     def test_profile_1a_populate(self):
         self.test_baseline_1a_populate()
 
-    @profiling.function_call_count(416)
+    @profiling.function_call_count(416, {'3.2':390})
     def test_profile_2_insert(self):
         self.test_baseline_2_insert()
 
@@ -349,6 +349,7 @@ class ZooMarkTest(fixtures.TestBase):
         '2.7': 5922,
         '2.7+cextension': 5714,
         '2.6+cextension': 5714,
+        '3.2':5787,
         })
     def test_profile_3_properties(self):
         self.test_baseline_3_properties()