From 53d4023e869a284608c92a313b13ec38c562d021 Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Thu, 10 Jun 2021 16:02:38 +0300 Subject: [PATCH] Revival of deprecated class (still used by plugins) GitOrigin-RevId: 4503f3f85d34d2fddb4931a48fe1acba8043ea01 --- .../python/testing/PythonUnitTestUtil.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 python/src/com/jetbrains/python/testing/PythonUnitTestUtil.java diff --git a/python/src/com/jetbrains/python/testing/PythonUnitTestUtil.java b/python/src/com/jetbrains/python/testing/PythonUnitTestUtil.java new file mode 100644 index 000000000000..217a60ccea91 --- /dev/null +++ b/python/src/com/jetbrains/python/testing/PythonUnitTestUtil.java @@ -0,0 +1,27 @@ +// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +package com.jetbrains.python.testing; + +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.util.ThreeState; +import com.jetbrains.python.psi.PyClass; +import com.jetbrains.python.psi.types.TypeEvalContext; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public final class PythonUnitTestUtil { + private PythonUnitTestUtil() { + } + + /** + * @deprecated use {@link PythonUnitTestDetectorsBasedOnSettings#isTestClass(PyClass, ThreeState, TypeEvalContext)} + */ + @Deprecated + @ApiStatus.ScheduledForRemoval(inVersion = "2021.1") + public static boolean isTestClass(@NotNull final PyClass cls, + @NotNull final ThreeState testCaseClassRequired, + @Nullable TypeEvalContext context) { + Logger.getInstance(PythonUnitTestUtil.class).warn("Please to not use deprecated class " + PythonUnitTestUtil.class.getCanonicalName()); + return PythonUnitTestDetectorsBasedOnSettings.isTestClass(cls, testCaseClassRequired, context); + } +}