MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / getTestCaseNames

Method getTestCaseNames

tests/runner.py:17–33  ·  view source on GitHub ↗

Customize this code to allow you to filter test methods through testNamePatterns.

(self, testCaseClass)

Source from the content-addressed store, hash-verified

15 testNamePatterns = None
16
17 def getTestCaseNames(self, testCaseClass):
18 """
19 Customize this code to allow you to filter test methods through testNamePatterns.
20 """
21 def shouldIncludeMethod(attrname):
22 if not attrname.startswith(self.testMethodPrefix):
23 return False
24 testFunc = getattr(testCaseClass, attrname)
25 if not callable(testFunc):
26 return False
27 return self.testNamePatterns is None or \
28 any(fnmatchcase(attrname, pattern) for pattern in self.testNamePatterns)
29
30 testFnNames = list(filter(shouldIncludeMethod, dir(testCaseClass)))
31 if self.sortTestMethodsUsing:
32 testFnNames.sort(key=functools.cmp_to_key(self.sortTestMethodsUsing))
33 return testFnNames
34
35
36if __name__ == '__main__':

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected