From 5f768d6565663faa89af5ab047a57e9da0f73602 Mon Sep 17 00:00:00 2001 From: R David Murray Date: Thu, 11 Apr 2013 08:55:45 -0400 Subject: #14971: Use class method name, not function.__name__, during unittest discovery. --- Lib/unittest/loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/unittest/loader.py') diff --git a/Lib/unittest/loader.py b/Lib/unittest/loader.py index 541884e416..2b92525423 100644 --- a/Lib/unittest/loader.py +++ b/Lib/unittest/loader.py @@ -111,7 +111,7 @@ class TestLoader(object): elif (isinstance(obj, types.FunctionType) and isinstance(parent, type) and issubclass(parent, case.TestCase)): - name = obj.__name__ + name = parts[-1] inst = parent(name) # static methods follow a different path if not isinstance(getattr(inst, name), types.FunctionType): -- cgit v1.2.1