void () { myFixture.copyDirectoryToProject("codeInsight/classMRO/" + getTestName(false), ""); final VirtualFile d = myFixture.findFileInTempDir("D.py"); final VirtualFile bc = myFixture.findFileInTempDir("BC.py"); final PyFile dPsi = (PyFile)myFixture.getPsiManager().findFile(d); final PsiFile bPsi = myFixture.getPsiManager().findFile(bc); //noinspection ResultOfMethodCallIgnored bPsi.getNode(); // unstubbing is necessary final PyClass dClass = dPsi.findTopLevelClass("D"); final TypeEvalContext context = TypeEvalContext.codeAnalysis(myFixture.getProject(), dPsi); // such context is necessary final List<PyClass> ancestors = dClass.getAncestorClasses(context); assertOrderedEquals(ContainerUtil.map(ancestors, PyClass::getName), Arrays.asList("C", "A", "B", PyNames.OBJECT)); }