PsiFile (@NotNull final PsiElement anchor, @NotNull final PyTestCreationModel creationModel) { final Project project = anchor.getProject(); return PostprocessReformattingAspect.getInstance(project).postponeFormattingInside( () -> ApplicationManager.getApplication().runWriteAction((Computable<PsiFile>)() -> { try { final PyElement testClass = generateTest(anchor, creationModel); testClass.navigate(false); return testClass.getContainingFile(); } catch (IncorrectOperationException e) { LOG.warn(e); return null; } })); }