void () { Map<String, PsiElement> marks = loadTest(); Assert.assertEquals(4, marks.size()); PsiElement elt = marks.get("<stmt>").getParent().getParent(); // keyword -> part -> stmt Assert.assertTrue(elt instanceof PyForStatement); PyForStatement stmt = (PyForStatement)elt; PyForPart for_part = stmt.getForPart(); PyExpression target = for_part.getTarget(); Assert.assertEquals(marks.get("<target>").getParent(), target); // ident -> expr PyExpression source = for_part.getSource(); Assert.assertEquals(marks.get("<source>").getParent(), source); // ident -> expr elt = marks.get("<else>").getParent(); // keyword -> part Assert.assertTrue(elt instanceof PyElsePart); Assert.assertEquals(stmt.getElsePart(), elt); }