mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed PY-9074 Test runner starts all tests if cursor is at the very end of the test method
This commit is contained in:
@@ -33,10 +33,7 @@ import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiFileSystemItem;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.jetbrains.python.PythonModuleTypeBase;
|
||||
import com.jetbrains.python.facet.PythonFacetSettings;
|
||||
@@ -116,7 +113,10 @@ abstract public class PythonTestConfigurationProducer extends RunConfigurationPr
|
||||
if (context == null) return false;
|
||||
final Location location = context.getLocation();
|
||||
if (location == null || !isAvailable(location)) return false;
|
||||
final PsiElement element = location.getPsiElement();
|
||||
PsiElement element = location.getPsiElement();
|
||||
if (element instanceof PsiWhiteSpace) {
|
||||
element = PyUtil.findNonWhitespaceAtOffset(element.getContainingFile(), element.getTextOffset());
|
||||
}
|
||||
|
||||
if (PythonUnitTestRunnableScriptFilter.isIfNameMain(location)) return false;
|
||||
final Module module = location.getModule();
|
||||
|
||||
Reference in New Issue
Block a user