diff options
author | Jason Fried <me@jasonfried.info> | 2019-01-23 12:57:25 -0800 |
---|---|---|
committer | Ćukasz Langa <lukasz@langa.pl> | 2019-01-23 21:57:25 +0100 |
commit | fd628cf5adaeee73eab579393cdff71c8f70cdf2 (patch) | |
tree | 7695ac974b593adb2b24121f6a8476551e8ed5e4 /Lib/unittest/loader.py | |
parent | f6243ac1e4828299fe5a8e943d7bd41cab1f34cd (diff) | |
download | cpython-git-fd628cf5adaeee73eab579393cdff71c8f70cdf2.tar.gz |
bpo-35767: Fix unittest.loader to allow partials as test_functions (#11600)
Diffstat (limited to 'Lib/unittest/loader.py')
-rw-r--r-- | Lib/unittest/loader.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/unittest/loader.py b/Lib/unittest/loader.py index d936a96e73..ba7105e1ad 100644 --- a/Lib/unittest/loader.py +++ b/Lib/unittest/loader.py @@ -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))) |