void (final String className, final String superclassName, final String expectedError, final boolean sameFile, boolean asAbstract, final String... membersName) { try { String baseName = "refactoring/extractsuperclass/" + getTestName(true); myFixture.configureByFile(baseName + ".before.py"); final PyClass clazz = findClass(className); final List<PyMemberInfo<PyElement>> members = new ArrayList<>(); for (String memberName : membersName) { final PyElement member = findMember(className, memberName); final PyMemberInfo<PyElement> memberInfo = MembersManager.findMember(clazz, member); memberInfo.setToAbstract(asAbstract); members.add(memberInfo); } WriteCommandAction.writeCommandAction(myFixture.getProject()).run(() -> { final String url = sameFile ? myFixture.getFile().getVirtualFile().getUrl() : myFixture.getFile().getVirtualFile().getParent().getUrl(); PyExtractSuperclassHelper.extractSuperclass(clazz, members, superclassName, url); }); myFixture.checkResultByFile(baseName + ".after.py"); } catch (Exception e) { if (expectedError == null) throw e; assertEquals(expectedError, e.getMessage()); } }