mirror of
https://github.com/mamoe/mirai.git
synced 2024-12-29 10:00:13 +08:00
[core] AbstractRealNetworkHandlerTest: close bot after each test only if bot was created
This commit is contained in:
parent
e3e71e1d1f
commit
0a7df909ca
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user