mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-19 01:18:19 +08:00
fix nonebot-test
This commit is contained in:
parent
c4a5cfb513
commit
865fd6af4c
@ -10,11 +10,6 @@ from nonebot.config import Env, Config
|
||||
from nonebot.adapters.cqhttp import Bot as CQBot
|
||||
from nonebot.typing import Type, Union, Driver, Optional, NoReturn
|
||||
|
||||
try:
|
||||
import nonebot_test
|
||||
except ImportError:
|
||||
nonebot_test = None
|
||||
|
||||
_driver: Optional[Driver] = None
|
||||
|
||||
|
||||
@ -34,6 +29,17 @@ def get_asgi():
|
||||
return driver.asgi
|
||||
|
||||
|
||||
def get_bots():
|
||||
driver = get_driver()
|
||||
return driver.bots
|
||||
|
||||
|
||||
try:
|
||||
import nonebot_test
|
||||
except ImportError:
|
||||
nonebot_test = None
|
||||
|
||||
|
||||
def init(*, _env_file: Optional[str] = None, **kwargs):
|
||||
global _driver
|
||||
env = Env()
|
||||
|
Loading…
Reference in New Issue
Block a user