void (String before, final String after, boolean parenthesiseOnEnter) { boolean initialValue = PyCodeInsightSettings.getInstance().PARENTHESISE_ON_ENTER; try { PyCodeInsightSettings.getInstance().PARENTHESISE_ON_ENTER = parenthesiseOnEnter; int pos = before.indexOf("<caret>"); before = before.replace("<caret>", ""); doTestTyping(before, pos, '\n'); myFixture.checkResult(after); } finally { PyCodeInsightSettings.getInstance().PARENTHESISE_ON_ENTER = initialValue; } }