diff --git a/platform/testFramework/core/src/com/intellij/TestCaseLoader.java b/platform/testFramework/core/src/com/intellij/TestCaseLoader.java index 75c046ebea70..1505f78e9552 100644 --- a/platform/testFramework/core/src/com/intellij/TestCaseLoader.java +++ b/platform/testFramework/core/src/com/intellij/TestCaseLoader.java @@ -618,7 +618,8 @@ public class TestCaseLoader { // called reflectively from `JUnit5TeamCityRunnerForTestsOnClasspath#createClassNameFilter` @SuppressWarnings("unused") public static boolean isClassNameIncluded(String className) { - if (!ClassFinder.isSuitableTestClassName(className, INCLUDE_UNCONVENTIONALLY_NAMED_TESTS)) { + String classNameWithoutPackage = StringsKt.substringAfterLast(className, '.', className); + if (!ClassFinder.isSuitableTestClassName(classNameWithoutPackage, INCLUDE_UNCONVENTIONALLY_NAMED_TESTS)) { return false; } if ("_FirstInSuiteTest".equals(className) || "_LastInSuiteTest".equals(className)) {