💥 remove deprecated nonebot.plugins toml table (#1151)

Feature: 移除过时的 `nonebot.plugins` toml 配置
This commit is contained in:
Ju4tCode
2022-08-16 10:03:37 +08:00
committed by GitHub
parent cdc507bab9
commit 898c29d7ee
8 changed files with 42 additions and 10 deletions

View File

@ -51,6 +51,29 @@ async def test_load_nested_plugin(app: App, load_plugin: Set["Plugin"]):
assert parent_plugin.sub_plugins == {sub_plugin, sub_plugin2}
@pytest.mark.asyncio
async def test_load_json(app: App):
import nonebot
nonebot.load_from_json("./plugins.json")
with pytest.raises(TypeError):
nonebot.load_from_json("./plugins.invalid.json")
@pytest.mark.asyncio
async def test_load_toml(app: App):
import nonebot
nonebot.load_from_toml("./plugins.toml")
with pytest.raises(ValueError):
nonebot.load_from_toml("./plugins.empty.toml")
with pytest.raises(TypeError):
nonebot.load_from_toml("./plugins.invalid.toml")
@pytest.mark.asyncio
async def test_bad_plugin(app: App):
import nonebot