From da938820ec731b55e5285b202436668e49edf14b Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 27 Mar 2011 18:16:40 -0400 Subject: [PATCH] - fix a callcount - 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 | 2 +- test/lib/fixtures.py | 33 +++++++-------------------------- test/orm/test_scoping.py | 3 --- 3 files changed, 8 insertions(+), 30 deletions(-) diff --git a/test/aaa_profiling/test_orm.py b/test/aaa_profiling/test_orm.py index b0b0128616..25e84b9f3d 100644 --- a/test/aaa_profiling/test_orm.py +++ b/test/aaa_profiling/test_orm.py @@ -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} ) diff --git a/test/lib/fixtures.py b/test/lib/fixtures.py index b325975ff2..6714107bdc 100644 --- a/test/lib/fixtures.py +++ b/test/lib/fixtures.py @@ -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]]) - - diff --git a/test/orm/test_scoping.py b/test/orm/test_scoping.py index 527df89371..978a8bc1da 100644 --- a/test/orm/test_scoping.py +++ b/test/orm/test_scoping.py @@ -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() -- 2.47.2