void (@Nullable Consumer<IntroduceOperation> customization) { String name = getTestName(true); myFixture.configureByFile(name + ".py"); final boolean enabled = myFixture.getEditor().getSettings().isVariableInplaceRenameEnabled(); try { TemplateManagerImpl.setTemplateTesting(myFixture.getTestRootDisposable()); myFixture.getEditor().getSettings().setVariableInplaceRenameEnabled(true); IntroduceHandler handler = createHandler(); final IntroduceOperation introduceOperation = new IntroduceOperation(myFixture.getProject(), myFixture.getEditor(), myFixture.getFile(), "a"); introduceOperation.setReplaceAll(true); if (customization != null) { customization.consume(introduceOperation); } handler.performAction(introduceOperation); WriteCommandAction.runWriteCommandAction(myFixture.getProject(), () -> { TemplateState state = TemplateManagerImpl.getTemplateState(myFixture.getEditor()); assert state != null; state.gotoEnd(false); }); myFixture.checkResultByFile(name + ".after.py", true); } finally { myFixture.getEditor().getSettings().setVariableInplaceRenameEnabled(enabled); } }