From 2142bbafe8f99538edd2cbc067030c85cf8bdaa0 Mon Sep 17 00:00:00 2001 From: Alexandr Evstigneev Date: Mon, 14 Dec 2020 13:23:08 +0300 Subject: [PATCH] Suppress debug logging for assumption violations In the light test we are wrapping logging around test run only, but not setUp or teardown. Therefore when debug output is empty, we are logging nothing. In heavy test for better diagnostics we are wrapping tests with setUp and tearDown and setUp is always debugging something, so buffer is not empty. With current solution we just wont log anything if assumption violation happened. GitOrigin-RevId: dc412ea9385a148a88bc465caa5b0547accc3a71 --- .../src/com/intellij/testFramework/UsefulTestCase.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java b/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java index 7abc0c0f22a3..0014867d7db9 100644 --- a/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java @@ -534,6 +534,10 @@ public abstract class UsefulTestCase extends TestCase { testRunnable.run(); success = true; } + catch (AssumptionViolatedException e) { + success = true; + throw e; + } finally { TestLoggerFactory.onTestFinished(success); }