mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-19 20:34:44 +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
|
@AfterTest
|
||||||
fun afterEach() {
|
fun afterEach() {
|
||||||
println("Test finished, closing Bot")
|
println("Test finished, closing Bot")
|
||||||
if (botInit) bot.close()
|
if (botInit) {
|
||||||
|
bot.close()
|
||||||
|
println("joining Bot")
|
||||||
runBlockingUnit { bot.join() }
|
runBlockingUnit { bot.join() }
|
||||||
|
println("cleanup ok")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun createBot(account: BotAccount = MockAccount): QQAndroidBot {
|
protected open fun createBot(account: BotAccount = MockAccount): QQAndroidBot {
|
||||||
|
Loading…
Reference in New Issue
Block a user