首页 > 解决方案 > 在 Kotlin 中使用不同的 RunWith 编写测试

问题描述

我有一堂课,其中一批测试需要@RunWith(RobolectricTestRunner::class),而另一个需要@RunWith(PowerMockRunner::class)。我没有任何同时需要两者的测试。

我不愿意同时使用两者,因为我正在使用该库'org.powermock:powermock-module-junit4-rule-agent并且我不想将其替换为 powermock-module-junit4-rule

有什么好的方法吗?

标签: kotlintestingjunitrobolectricpowermockito

解决方案


推荐阅读