summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-08-14 09:32:08 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-08-14 09:34:28 -0400
commitbb9d511e52ee5ab3621d8595328ee2400242461a (patch)
treeab575b9fb2eff1e4e44439fe15de38fec5a2b600 /lib/sqlalchemy/testing
parente331da58a6d136aff824b43312424083090a7c90 (diff)
downloadsqlalchemy-bb9d511e52ee5ab3621d8595328ee2400242461a.tar.gz
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
Diffstat (limited to 'lib/sqlalchemy/testing')
-rw-r--r--lib/sqlalchemy/testing/plugin/plugin_base.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py
index e01fa9bd0..ab968a379 100644
--- a/lib/sqlalchemy/testing/plugin/plugin_base.py
+++ b/lib/sqlalchemy/testing/plugin/plugin_base.py
@@ -409,11 +409,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
}
)
@@ -459,11 +461,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)