diff -r 07d07111cec9 Lib/test/test_genericpath.py --- a/Lib/test/test_genericpath.py Wed Jan 02 18:22:23 2013 +0200 +++ b/Lib/test/test_genericpath.py Wed Jan 02 16:14:19 2013 -0600 @@ -17,7 +17,7 @@ pass -class GenericTest(unittest.TestCase): +class GenericTest: # The path module to be tested pathmodule = genericpath common_attributes = ['commonprefix', 'getsize', 'getatime', 'getctime', @@ -270,6 +270,12 @@ self.assertTrue(self.pathmodule.sameopenfile( a.fileno(), b.fileno())) +class TestGenericTest(GenericTest, unittest.TestCase): + # Issue 16748: GenericTest can't inherit from unittest.TestCase + # for test discovery purposes; CommonTest inherits from GenericTest + # and is only meant to be inherited by others. + pass + # Following TestCase is not supposed to be run from test_genericpath. # It is inherited by other test modules (macpath, ntpath, posixpath). diff -r 07d07111cec9 Lib/test/test_macpath.py --- a/Lib/test/test_macpath.py Wed Jan 02 18:22:23 2013 +0200 +++ b/Lib/test/test_macpath.py Wed Jan 02 16:14:19 2013 -0600 @@ -115,7 +115,7 @@ self.assertEqual(normpath(b"a:b:"), b"a:b") -class MacCommonTest(test_genericpath.CommonTest): +class MacCommonTest(test_genericpath.CommonTest, unittest.TestCase): pathmodule = macpath diff -r 07d07111cec9 Lib/test/test_ntpath.py --- a/Lib/test/test_ntpath.py Wed Jan 02 18:22:23 2013 +0200 +++ b/Lib/test/test_ntpath.py Wed Jan 02 16:14:19 2013 -0600 @@ -257,7 +257,7 @@ ntpath.sameopenfile(-1, -1) -class NtCommonTest(test_genericpath.CommonTest): +class NtCommonTest(test_genericpath.CommonTest, unittest.TestCase): pathmodule = ntpath attributes = ['relpath', 'splitunc'] diff -r 07d07111cec9 Lib/test/test_posixpath.py --- a/Lib/test/test_posixpath.py Wed Jan 02 18:22:23 2013 +0200 +++ b/Lib/test/test_posixpath.py Wed Jan 02 16:14:19 2013 -0600 @@ -462,7 +462,7 @@ os.getcwdb = real_getcwdb -class PosixCommonTest(test_genericpath.CommonTest): +class PosixCommonTest(test_genericpath.CommonTest, unittest.TestCase): pathmodule = posixpath attributes = ['relpath', 'samefile', 'sameopenfile', 'samestat']