[core] AbstractRealNetworkHandlerTest: close bot after each test only if bot was created

This commit is contained in:
Him188 2022-12-27 17:30:14 +00:00
parent e3e71e1d1f
commit 0a7df909ca
No known key found for this signature in database
GPG Key ID: BA439CDDCF652375

View File

@ -60,8 +60,12 @@ internal abstract class AbstractRealNetworkHandlerTest<H : NetworkHandler> : Abs
@AfterTest
fun afterEach() {
println("Test finished, closing Bot")
if (botInit) bot.close()
runBlockingUnit { bot.join() }
if (botInit) {
bot.close()
println("joining Bot")
runBlockingUnit { bot.join() }
println("cleanup ok")
}
}
protected open fun createBot(account: BotAccount = MockAccount): QQAndroidBot {