From: Mike Bayer Date: Mon, 14 Aug 2017 13:32:08 +0000 (-0400) Subject: Restore original test names X-Git-Tag: rel_1_1_14~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af15353315a40704f4cb8d2599605ce04e335387;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Restore original test names The change in de1f8f8345ecd6af0ec1177703465e9471cfe862 modified how test classes are named, breaking logic that extracts the class name for the profiling suite. Add a new variable _sa_orig_cls_name if we've modified the name so that the profiling logic doesn't need to guess the original class name. Change-Id: Ica15a97408b9e0749a78c87f62749c15c1627009 (cherry picked from commit bb9d511e52ee5ab3621d8595328ee2400242461a) --- diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py index 277e646007..ab25292201 100644 --- a/lib/sqlalchemy/testing/plugin/plugin_base.py +++ b/lib/sqlalchemy/testing/plugin/plugin_base.py @@ -425,11 +425,13 @@ def want_method(cls, fn): def generate_sub_tests(cls, module): if getattr(cls, '__backend__', False): for cfg in _possible_configs_for_cls(cls): + orig_name = cls.__name__ name = "%s_%s" % (cls.__name__, cfg.name) subcls = type( name, (cls, ), { + "_sa_orig_cls_name": orig_name, "__only_on_config__": cfg } ) @@ -475,11 +477,8 @@ def before_test(test, test_module_name, test_class, test_name): # like a nose id, e.g.: # "test.aaa_profiling.test_compiler.CompileTest.test_update_whereclause" - name = test_class.__name__ - suffix = "_%s_%s" % (config.db.name, config.db.driver) - if name.endswith(suffix): - name = name[0:-(len(suffix))] + name = getattr(test_class, '_sa_orig_cls_name', test_class.__name__) id_ = "%s.%s.%s" % (test_module_name, name, test_name)