diff --git a/plugins/org.python.pydev/tests/org/python/pydev/editor/correctionassist/heuristics/AssistSurroundWithTest.java b/plugins/org.python.pydev/tests/org/python/pydev/editor/correctionassist/heuristics/AssistSurroundWithTest.java index ed6e6fc659..d23d6fcfa5 100644 --- a/plugins/org.python.pydev/tests/org/python/pydev/editor/correctionassist/heuristics/AssistSurroundWithTest.java +++ b/plugins/org.python.pydev/tests/org/python/pydev/editor/correctionassist/heuristics/AssistSurroundWithTest.java @@ -8,6 +8,7 @@ import java.util.List; +import org.eclipse.core.runtime.AssertionFailedException; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IAutoIndentStrategy; import org.eclipse.jface.text.IDocument; @@ -89,7 +90,7 @@ public void testSurround2() throws Exception { " #c\n" + " a = 10\n" + - " except:\n" + + " except Exception:\n" + " raise\n" + "\n" + "\n" + @@ -98,7 +99,13 @@ public void testSurround2() throws Exception { private void apply(ICompletionProposalHandle iCompletionProposalHandle, IDocument doc) { TemplateProposal p = (TemplateProposal) iCompletionProposalHandle; - p.apply(createViewerWithDoc(doc), ' ', 0, 0); + try { + p.apply(createViewerWithDoc(doc), ' ', 0, 0); + } catch (AssertionFailedException e) { + // Ignore (we have errors linking with the UI because it's not there and + // TemplateProposal isn't smart enough to work without it, but it can at least + // do the replacement before failing). + } } public void testSurround3() throws Exception { @@ -121,7 +128,7 @@ public void testSurround3() throws Exception { " #c\n" + " # a = 10\n" + - "except:\n" + + "except Exception:\n" + " raise\n" + "\n" + "\n" + @@ -138,7 +145,7 @@ public void testSurround() throws Exception { TestCaseUtils.assertContentsEqual("" + "try:\n" + " a = 10\n" + - "except:\n" + + "except Exception:\n" + " raise" + "", doc.get()); @@ -158,7 +165,7 @@ public void testSurround() throws Exception { + " \n" + " \n" + " a = 10\n" - + " except:\n" + + " except Exception:\n" + " raise", additionalProposalInfo); @@ -171,7 +178,7 @@ public void testSurround() throws Exception { " \n" + " a = 10\n" + - " except:\n" + + " except Exception:\n" + " raise\n" + "\n" + "\n" +