dotest -f does not work on Python3.
The name types.UnboundMethodType was an alias for types.MethodType in
2.7, but it does not exist in python3. MethodType works in both.
Also the actual type returned from SomeClass.some_method in python3
will be types.Function, not MethodType.
Patch by: Lawrence D'Anna
Differential revision: https://reviews.llvm.org/D67791
llvm-svn: 372441
return self.loadTestsFromModule(obj)
elif isinstance(obj, type) and issubclass(obj, unittest.TestCase):
return self.loadTestsFromTestCase(obj)
- elif (isinstance(obj, types.UnboundMethodType) and
+ elif (isinstance(obj, (types.MethodType, types.FunctionType)) and
isinstance(parent, type) and
issubclass(parent, case.TestCase)):
return self.suiteClass([parent(obj.__name__)])