]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- fix a callcount
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 27 Mar 2011 22:16:40 +0000 (18:16 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 27 Mar 2011 22:16:40 +0000 (18:16 -0400)
- remove extra _load_fixtures() method.   using the classbound version as the fixtures
seem to have everything classlevel at the moment (wondering if we want to change that
for non-classlevel setup/teardown)

test/aaa_profiling/test_orm.py
test/lib/fixtures.py
test/orm/test_scoping.py

index b0b0128616d3ad4efaf3262d44e020c3f6b2fe80..25e84b9f3db48a7c6cd429462cb18588e3eb25d1 100644 (file)
@@ -88,7 +88,7 @@ class MergeTest(fixtures.MappedTest):
 
         @profiling.function_call_count(
                                 versions={'2.5':1050, '2.6':1050,
-                                        '2.6+cextension':1041
+                                        '2.6+cextension':988
                                         '2.7':1005,
                                         '3':1005}
                             )
index b325975ff29adc21b3e956010b233c68dfc7c662..6714107bdc4d759a9ac9b704134cb2605daf91c6 100644 (file)
@@ -24,8 +24,6 @@ class TestBase(object):
     # skipped.
     __skip_if__ = None
 
-    _artifact_registries = ()
-
     def assert_(self, val, msg=None):
         assert val, msg
 
@@ -178,17 +176,19 @@ class TablesTest(TestBase):
         self.assert_sql(self.bind,
                         callable_, statements, with_sequences)
 
-    def _load_fixtures(self):
+    @classmethod
+    def _load_fixtures(cls):
+        """Insert rows as represented by the fixtures() method."""
         headers, rows = {}, {}
-        for table, data in self.fixtures().iteritems():
+        for table, data in cls.fixtures().iteritems():
             if isinstance(table, basestring):
-                table = self.tables[table]
+                table = cls.tables[table]
             headers[table] = data[0]
             rows[table] = data[1:]
-        for table in self.metadata.sorted_tables:
+        for table in cls.metadata.sorted_tables:
             if table not in headers:
                 continue
-            self.bind.execute(
+            cls.bind.execute(
                 table.insert(),
                 [dict(zip(headers[table], column_values))
                  for column_values in rows[table]])
@@ -294,22 +294,3 @@ class MappedTest(_ORMTest, TablesTest, testing.AssertsExecutionResults):
     def setup_mappers(cls):
         pass
 
-    @classmethod
-    def _load_fixtures(cls):
-        """Insert rows as represented by the fixtures() method."""
-
-        headers, rows = {}, {}
-        for table, data in cls.fixtures().iteritems():
-            if isinstance(table, basestring):
-                table = cls.tables[table]
-            headers[table] = data[0]
-            rows[table] = data[1:]
-        for table in cls.metadata.sorted_tables:
-            if table not in headers:
-                continue
-            table.bind.execute(
-                table.insert(),
-                [dict(zip(headers[table], column_values))
-                 for column_values in rows[table]])
-
-
index 527df8937149c6d308a9868bb467d7c16fc1548b..978a8bc1da6c6fc0659c247adff7e5544ddeeb9c 100644 (file)
@@ -15,9 +15,6 @@ class _ScopedTest(fixtures.MappedTest):
 
     run_setup_mappers = 'once'
 
-    _artifact_registries = (
-        fixtures.MappedTest._artifact_registries + ('scoping',))
-
     @classmethod
     def setup_class(cls):
         cls.scoping = _base.adict()