From d2cd69fc9efde1db13f26f1d341708c536f57ca8 Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Thu, 12 Dec 2019 19:43:46 +0300 Subject: [PATCH] Fix test (call dispose() in finally) GitOrigin-RevId: c0c8ce3f691fc09d728a347e2e364f14375422cf --- .../env/python/testing/PythonUnitTestingTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/testSrc/com/jetbrains/env/python/testing/PythonUnitTestingTest.java b/python/testSrc/com/jetbrains/env/python/testing/PythonUnitTestingTest.java index 0b6343dc4ea7..9a9cfacc7d84 100644 --- a/python/testSrc/com/jetbrains/env/python/testing/PythonUnitTestingTest.java +++ b/python/testSrc/com/jetbrains/env/python/testing/PythonUnitTestingTest.java @@ -142,12 +142,16 @@ public final class PythonUnitTestingTest extends PythonUnitTestingLikeTest { final PythonConsoleView console = new PythonConsoleView(project, "test", sdk, true); - Disposer.register(myFixture.getModule(), console); + console.getComponent(); //To init editor Arrays.stream(messages).forEach((s) -> console.print(s, ConsoleViewContentType.NORMAL_OUTPUT)); console.flushDeferredText(); - assertEquals("TC messages filtered in wrong way", "Hello\nI am\nPyCharm", console.getText()); + try { + assertEquals("TC messages filtered in wrong way", "Hello\nI am\nPyCharm", console.getText()); + }finally { + Disposer.dispose(console); + } }); } });