void () { final PsiFile file = prepareFile(); final PsiManager psiManager = myFixture.getPsiManager(); final VirtualFile dir = myFixture.findFileInTempDir("a.py"); final PsiFile psiFile = psiManager.findFile(dir); //noinspection ConstantConditions we need to unstub a.py here ((PsiFileImpl)psiFile).calcTreeElement(); final PsiElement element; try { element = doResolve(file); } catch (Exception e) { throw new RuntimeException(e); } assertResolveResult(element, PyClass.class, "A"); }