MCPcopy Index your code
hub / github.com/RustPython/RustPython / shouldIncludeMethod

Method shouldIncludeMethod

Lib/unittest/loader.py:212–222  ·  view source on GitHub ↗
(attrname)

Source from the content-addressed store, hash-verified

210 """Return a sorted sequence of method names found within testCaseClass
211 """
212 def shouldIncludeMethod(attrname):
213 if not attrname.startswith(self.testMethodPrefix):
214 return False
215 testFunc = getattr(testCaseClass, attrname)
216 if not callable(testFunc):
217 return False
218 fullName = f'%s.%s.%s' % (
219 testCaseClass.__module__, testCaseClass.__qualname__, attrname
220 )
221 return self.testNamePatterns is None or \
222 any(fnmatchcase(fullName, pattern) for pattern in self.testNamePatterns)
223 testFnNames = list(filter(shouldIncludeMethod, dir(testCaseClass)))
224 if self.sortTestMethodsUsing:
225 testFnNames.sort(key=functools.cmp_to_key(self.sortTestMethodsUsing))

Callers

nothing calls this directly

Calls 5

fnmatchcaseFunction · 0.90
getattrFunction · 0.85
callableFunction · 0.85
anyFunction · 0.50
startswithMethod · 0.45

Tested by

no test coverage detected