diff --git a/idea/tests/org/jetbrains/kotlin/idea/refactoring/AbstractMultifileRefactoringTest.kt b/idea/tests/org/jetbrains/kotlin/idea/refactoring/AbstractMultifileRefactoringTest.kt index d61b438ddc2..ec74bc8c2df 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/refactoring/AbstractMultifileRefactoringTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/refactoring/AbstractMultifileRefactoringTest.kt @@ -130,14 +130,12 @@ fun runRefactoringTest( catch(e: BaseRefactoringProcessor.ConflictsInTestsException) { KotlinTestUtils.assertEqualsToFile(conflictFile, e.messages.distinct().sorted().joinToString("\n")) - BaseRefactoringProcessor.ConflictsInTestsException.setTestIgnore(true) - - // Run refactoring again with ConflictsInTestsException suppressed - action.runRefactoring(rootDir, mainPsiFile, elementsAtCaret, config) + BaseRefactoringProcessor.ConflictsInTestsException.withIgnoredConflicts { + // Run refactoring again with ConflictsInTestsException suppressed + action.runRefactoring(rootDir, mainPsiFile, elementsAtCaret, config) + } } finally { - BaseRefactoringProcessor.ConflictsInTestsException.setTestIgnore(false) - EditorFactory.getInstance()!!.releaseEditor(editor) } } \ No newline at end of file