diff -r 719c11b6b6ff Lib/unittest/case.py --- a/Lib/unittest/case.py Wed Apr 06 09:50:03 2016 +0300 +++ b/Lib/unittest/case.py Mon Apr 11 20:44:13 2016 +0300 @@ -481,7 +481,7 @@ return hash((type(self), self._testMethodName)) def __str__(self): - return "%s (%s)" % (self._testMethodName, strclass(self.__class__)) + return "%s (%s.%s)" % (self._testMethodName, strclass(self.__class__), self._testMethodName) def __repr__(self): return "<%s testMethod=%s>" % \ diff -r 719c11b6b6ff Lib/unittest/test/test_result.py --- a/Lib/unittest/test/test_result.py Wed Apr 06 09:50:03 2016 +0300 +++ b/Lib/unittest/test/test_result.py Mon Apr 11 20:44:13 2016 +0300 @@ -299,7 +299,7 @@ self.assertEqual( result.getDescription(self), 'testGetDescriptionWithoutDocstring (' + __name__ + - '.Test_TestResult)') + '.Test_TestResult.testGetDescriptionWithoutDocstring)') def testGetSubTestDescriptionWithoutDocstring(self): with self.subTest(foo=1, bar=2): @@ -307,13 +307,13 @@ self.assertEqual( result.getDescription(self._subtest), 'testGetSubTestDescriptionWithoutDocstring (' + __name__ + - '.Test_TestResult) (bar=2, foo=1)') + '.Test_TestResult.testGetSubTestDescriptionWithoutDocstring) (bar=2, foo=1)') with self.subTest('some message'): result = unittest.TextTestResult(None, True, 1) self.assertEqual( result.getDescription(self._subtest), 'testGetSubTestDescriptionWithoutDocstring (' + __name__ + - '.Test_TestResult) [some message]') + '.Test_TestResult.testGetSubTestDescriptionWithoutDocstring) [some message]') def testGetSubTestDescriptionWithoutDocstringAndParams(self): with self.subTest(): @@ -321,7 +321,8 @@ self.assertEqual( result.getDescription(self._subtest), 'testGetSubTestDescriptionWithoutDocstringAndParams ' - '(' + __name__ + '.Test_TestResult) ()') + '(' + __name__ + '.Test_TestResult.testGetSubTestDescriptionWithoutDocstringAndParams) ' + '()') def testGetNestedSubTestDescriptionWithoutDocstring(self): with self.subTest(foo=1): @@ -330,7 +331,8 @@ self.assertEqual( result.getDescription(self._subtest), 'testGetNestedSubTestDescriptionWithoutDocstring ' - '(' + __name__ + '.Test_TestResult) (bar=2, foo=1)') + '(' + __name__ + '.Test_TestResult.testGetNestedSubTestDescriptionWithoutDocstring) ' + '(bar=2, foo=1)') @unittest.skipIf(sys.flags.optimize >= 2, "Docstrings are omitted with -O2 and above") @@ -340,7 +342,7 @@ self.assertEqual( result.getDescription(self), ('testGetDescriptionWithOneLineDocstring ' - '(' + __name__ + '.Test_TestResult)\n' + '(' + __name__ + '.Test_TestResult.testGetDescriptionWithOneLineDocstring)\n' 'Tests getDescription() for a method with a docstring.')) @unittest.skipIf(sys.flags.optimize >= 2, @@ -352,7 +354,8 @@ self.assertEqual( result.getDescription(self._subtest), ('testGetSubTestDescriptionWithOneLineDocstring ' - '(' + __name__ + '.Test_TestResult) (bar=2, foo=1)\n' + '(' + __name__ + '.Test_TestResult.testGetSubTestDescriptionWithOneLineDocstring) ' + '(bar=2, foo=1)\n' 'Tests getDescription() for a method with a docstring.')) @unittest.skipIf(sys.flags.optimize >= 2, @@ -365,7 +368,7 @@ self.assertEqual( result.getDescription(self), ('testGetDescriptionWithMultiLineDocstring ' - '(' + __name__ + '.Test_TestResult)\n' + '(' + __name__ + '.Test_TestResult.testGetDescriptionWithMultiLineDocstring)\n' 'Tests getDescription() for a method with a longer ' 'docstring.')) @@ -380,7 +383,8 @@ self.assertEqual( result.getDescription(self._subtest), ('testGetSubTestDescriptionWithMultiLineDocstring ' - '(' + __name__ + '.Test_TestResult) (bar=2, foo=1)\n' + '(' + __name__ + '.Test_TestResult.testGetSubTestDescriptionWithMultiLineDocstring) ' + '(bar=2, foo=1)\n' 'Tests getDescription() for a method with a longer ' 'docstring.'))