void (@Nullable String newName, @Nullable List<PyParameterInfo> parameters, @Nullable String expected) { myFixture.configureByFile("refactoring/changeSignature/" + getTestName(true) + ".py"); final PyChangeSignatureHandler changeSignatureHandler = new PyChangeSignatureHandler(); final PyFunction function = (PyFunction)changeSignatureHandler.findTargetMember(myFixture.getFile(), myFixture.getEditor()); assertNotNull(function); final PyMethodDescriptor method = new PyMethodDescriptor(function); final TestPyChangeSignatureDialog dialog = new TestPyChangeSignatureDialog(function.getProject(), method); try { if (newName != null) { dialog.setNewName(newName); } if (parameters != null) { dialog.setParameterInfos(parameters); } final String validationError = dialog.validateAndCommitData(); assertEquals(expected, validationError); } finally { Disposer.dispose(dialog.getDisposable()); } }