mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-16 02:50:48 +00:00
🐛 Fix: 修复 dotenv 配置项为 None 将会跳过赋值 (#2143)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
LOG_LEVEL=TRACE
|
||||
NICKNAME=["test"]
|
||||
SUPERUSERS=["test", "fake:faketest"]
|
||||
API_TIMEOUT
|
||||
SIMPLE_NONE
|
||||
COMMON_OVERRIDE=new
|
||||
CONFIG_FROM_ENV=
|
||||
CONFIG_OVERRIDE=old
|
||||
|
@ -20,6 +20,11 @@ async def test_init():
|
||||
assert env == "test"
|
||||
|
||||
config = nonebot.get_driver().config
|
||||
assert config.nickname == {"test"}
|
||||
assert config.superusers == {"test", "fake:faketest"}
|
||||
assert config.api_timeout is None
|
||||
|
||||
assert config.simple_none is None
|
||||
assert config.config_from_env == {"test": "test"}
|
||||
assert config.config_override == "new"
|
||||
assert config.config_from_init == "init"
|
||||
|
Reference in New Issue
Block a user