void () { final CodeStyleSettings settings = CodeStyle.getSettings(myFixture.getProject()); final CommonCodeStyleSettings pythonSettings = settings.getCommonSettings(PythonLanguage.getInstance()); int oldValue = pythonSettings.RIGHT_MARGIN; boolean oldMarginValue = settings.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN; pythonSettings.RIGHT_MARGIN = 100; settings.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = true; try { final String testName = "wrap/" + getTestName(true); myFixture.configureByFile(testName + ".py"); for (int i = 0; i != 45; ++i) { myFixture.type(' '); } myFixture.checkResultByFile(testName + ".after.py"); } finally { pythonSettings.RIGHT_MARGIN = oldValue; settings.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = oldMarginValue; } }