【问题标题】:akka-testkit without ScalaTest没有 ScalaTest 的 akka-testkit
【发布时间】:2019-12-10 21:24:55
【问题描述】:

我想将 utest 与 akka-testkit 一起使用。 如何在 akka-testkit 中禁用 ScalaTest?

运行测试,每次都会执行一个空的 ScalaTest。

[info] ScalaTest
[info] Run completed in 957 milliseconds.
[info] Total number of tests run: 0
[info] Suites: completed 0, aborted 0
[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
[info] No tests were executed.
[info] utest
[info] Tests: 1, Passed: 1, Failed: 0
[info] Passed: Total 1, Failed 0, Errors 0, Passed 1

【问题讨论】:

    标签: scalatest akka-testkit


    【解决方案1】:

    尝试通过将 ScalaTest 从 build.sbt 中的 testFrameworks 设置中过滤出来来取消注册,就像这样

    testFrameworks := {
      testFrameworks.value.filterNot(_.toString.contains("scalatest"))
    }
    

    现在show testFrameworks给了

    show testFrameworks
    [info] * TestFramework(org.scalacheck.ScalaCheckFramework)
    [info] * TestFramework(org.specs2.runner.Specs2Framework, org.specs2.runner.SpecsFramework)
    [info] * TestFramework(org.specs.runner.SpecsFramework)
    [info] * TestFramework(com.novocode.junit.JUnitFramework)
    [info] * TestFramework(utest.runner.Framework)
    

    我们看到TestFramework(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework) 的地方不存在。

    【讨论】:

      猜你喜欢
      • 2018-05-08
      • 2019-12-19
      • 1970-01-01
      • 1970-01-01
      • 2018-01-22
      • 1970-01-01
      • 2014-04-18
      • 1970-01-01
      • 2021-08-25
      相关资源
      最近更新 更多