diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-09-20 23:41:29 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-09-20 23:41:29 +0000 |
commit | e021d6909436c6baac2dc7c9065340862a9b9aa2 (patch) | |
tree | 833a06907cc007ba1db61a1193ed6132cd8c3203 /lldb/third_party/Python/module | |
parent | 2f32e5d84d3483a0d6170fc61d2cceb49fc930a3 (diff) | |
download | bcm5719-llvm-e021d6909436c6baac2dc7c9065340862a9b9aa2.tar.gz bcm5719-llvm-e021d6909436c6baac2dc7c9065340862a9b9aa2.zip |
dotest.py: bugfix: test filters with -f do not work on Python3
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
Diffstat (limited to 'lldb/third_party/Python/module')
-rw-r--r-- | lldb/third_party/Python/module/unittest2/unittest2/loader.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/third_party/Python/module/unittest2/unittest2/loader.py b/lldb/third_party/Python/module/unittest2/unittest2/loader.py index 996dd766475..87edddca402 100644 --- a/lldb/third_party/Python/module/unittest2/unittest2/loader.py +++ b/lldb/third_party/Python/module/unittest2/unittest2/loader.py @@ -117,7 +117,7 @@ class TestLoader(unittest.TestLoader): 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__)]) |