Skip to content

Commit b8eccd0

Browse files
authored
Be a little more lenient on what constitutes a test case entrypoint (#215)
Also allow "container" (e,g., classes) names to end with "Test." There are other testing framework derivatives in Python that allow for this, apparently.
1 parent d77c8b4 commit b8eccd0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PytestEntrypointBuilder.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ public static boolean isPytestCase(IClass klass) {
8282
IClass container = dmb.getContainer();
8383
String containerName = container.getReference().getName().getClassName().toString();
8484

85-
if (containerName.startsWith("Test") && container instanceof PythonClass) {
85+
if ((containerName.startsWith("Test") || containerName.endsWith("Test"))
86+
&& container instanceof PythonClass) {
8687
// It's a test class.
8788
PythonClass containerClass = (PythonClass) container;
8889

0 commit comments

Comments
 (0)