diff --git a/munit/shared/src/main/scala/munit/MUnitRunner.scala b/munit/shared/src/main/scala/munit/MUnitRunner.scala index 348d79b3..eac8d63b 100644 --- a/munit/shared/src/main/scala/munit/MUnitRunner.scala +++ b/munit/shared/src/main/scala/munit/MUnitRunner.scala @@ -122,15 +122,20 @@ class MUnitRunner(val cls: Class[_ <: Suite], newInstance: () => Suite) } def runAsync(notifier: RunNotifier): Future[Unit] = { val description = getDescription() - notifier.fireTestSuiteStarted(description) - runAll(notifier) - .transformCompat[Unit](result => { - result.failed.foreach(ex => - fireFailedHiddenTest(notifier, "unexpected error running tests", ex) - ) - notifier.fireTestSuiteFinished(description) - util.Success(()) - }) + if (PlatformCompat.isIgnoreSuite(cls) || munitTests.isEmpty) { + notifier.fireTestIgnored(description) + Future.successful(()) + } else { + notifier.fireTestSuiteStarted(description) + runAll(notifier) + .transformCompat[Unit](result => { + result.failed.foreach(ex => + fireFailedHiddenTest(notifier, "unexpected error running tests", ex) + ) + notifier.fireTestSuiteFinished(description) + util.Success(()) + }) + } } private def runTests( @@ -176,11 +181,6 @@ class MUnitRunner(val cls: Class[_ <: Suite], newInstance: () => Suite) } private def runAll(notifier: RunNotifier): Future[Unit] = { - if (PlatformCompat.isIgnoreSuite(cls) || munitTests.isEmpty) { - val description = getDescription() - notifier.fireTestIgnored(description) - return Future.successful(()) - } for { beforeAll <- runBeforeAll(notifier) _ <- { diff --git a/tests/shared/src/main/scala/munit/Issue497FrameworkSuite.scala b/tests/shared/src/main/scala/munit/Issue497FrameworkSuite.scala index b90198da..483a8810 100644 --- a/tests/shared/src/main/scala/munit/Issue497FrameworkSuite.scala +++ b/tests/shared/src/main/scala/munit/Issue497FrameworkSuite.scala @@ -34,8 +34,7 @@ class Issue497FrameworkSuite extends FunSuite { object Issue497FrameworkSuite extends FrameworkTest( classOf[Issue497FrameworkSuite], - """|munit.Issue497FrameworkSuite: - |""".stripMargin, + "", arguments = Array("--exclude-categories=munit.Slow"), tags = Set( OnlyJVM