boolean (@NotNull final PyFile file, @NotNull final ThreeState testCaseClassRequired, @Nullable final TypeEvalContext context) { if (file.getTopLevelClasses().stream().anyMatch(o -> isTestClass(o, testCaseClassRequired, context))) { return true; } if (isTestCaseClassRequired(file, testCaseClassRequired)) { return false; } return file.getName().startsWith("test_") || file.getTopLevelFunctions().stream().anyMatch(o -> isTestFunction(o, testCaseClassRequired, context)); }