mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
bpo-35767: Fix unittest.loader to allow partials as test_functions (#11600)
This commit is contained in:
parent
f6243ac1e4
commit
fd628cf5ad
2 changed files with 19 additions and 1 deletions
|
@ -229,7 +229,9 @@ class TestLoader(object):
|
|||
testFunc = getattr(testCaseClass, attrname)
|
||||
if not callable(testFunc):
|
||||
return False
|
||||
fullName = '%s.%s' % (testCaseClass.__module__, testFunc.__qualname__)
|
||||
fullName = f'%s.%s.%s' % (
|
||||
testCaseClass.__module__, testCaseClass.__qualname__, attrname
|
||||
)
|
||||
return self.testNamePatterns is None or \
|
||||
any(fnmatchcase(fullName, pattern) for pattern in self.testNamePatterns)
|
||||
testFnNames = list(filter(shouldIncludeMethod, dir(testCaseClass)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue