From: Mike Bayer Date: Thu, 27 Mar 2014 00:43:20 +0000 (-0400) Subject: fixes to get profiling tests working again X-Git-Tag: rel_0_9_4~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6411ee3cfe63d461b73e9aa8e69c6c550ddb649;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fixes to get profiling tests working again --- diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py index ceb6963edf..f38c7ea6a2 100644 --- a/lib/sqlalchemy/testing/plugin/pytestplugin.py +++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py @@ -114,7 +114,13 @@ def pytest_runtest_teardown(item): def test_setup(item): # like a nose id, e.g.: # "test.aaa_profiling.test_compiler.CompileTest.test_update_whereclause" - id_ = "%s.%s.%s" % (item.parent.module.__name__, item.parent.cls.__name__, item.name) + name = item.parent.cls.__name__ + + suffix = "_%s_%s" % (plugin_base.config.db.name, plugin_base.config.db.driver) + if name.endswith(suffix): + name = name[0:-(len(suffix))] + + id_ = "%s.%s.%s" % (item.parent.module.__name__, name, item.name) plugin_base.before_test(item, id_) def test_teardown(item): diff --git a/lib/sqlalchemy/testing/profiling.py b/lib/sqlalchemy/testing/profiling.py index 021218c348..2f92527e94 100644 --- a/lib/sqlalchemy/testing/profiling.py +++ b/lib/sqlalchemy/testing/profiling.py @@ -111,7 +111,7 @@ class ProfileStatsFile(object): # etc. self._write() - @util.memoized_property + @property def platform_key(self): dbapi_key = config.db.name + "_" + config.db.driver diff --git a/test/aaa_profiling/test_orm.py b/test/aaa_profiling/test_orm.py index ff55b1c269..db756fe8b6 100644 --- a/test/aaa_profiling/test_orm.py +++ b/test/aaa_profiling/test_orm.py @@ -10,7 +10,6 @@ from sqlalchemy.testing.schema import Table, Column import sys class MergeTest(fixtures.MappedTest): - __backend__ = True @classmethod def define_tables(cls, metadata): @@ -105,7 +104,6 @@ class LoadManyToOneFromIdentityTest(fixtures.MappedTest): to load 1000 related objects from the identity map. """ - __backend__ = True @classmethod @@ -260,7 +258,6 @@ class MergeBackrefsTest(fixtures.MappedTest): s.merge(a) class DeferOptionsTest(fixtures.MappedTest): - __backend__ = True @classmethod def define_tables(cls, metadata): @@ -316,7 +313,6 @@ class DeferOptionsTest(fixtures.MappedTest): class AttributeOverheadTest(fixtures.MappedTest): - __backend__ = True @classmethod def define_tables(cls, metadata):