mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-06 12:06:45 +00:00
⚡ improve plugin system (#1011)
This commit is contained in:
1
tests/plugins/_hidden.py
Normal file
1
tests/plugins/_hidden.py
Normal file
@ -0,0 +1 @@
|
||||
assert False
|
@ -3,4 +3,4 @@ from nonebot import export
|
||||
|
||||
@export()
|
||||
def test():
|
||||
...
|
||||
return "export"
|
||||
|
6
tests/plugins/nested/__init__.py
Normal file
6
tests/plugins/nested/__init__.py
Normal file
@ -0,0 +1,6 @@
|
||||
from pathlib import Path
|
||||
|
||||
import nonebot
|
||||
|
||||
_sub_plugins = set()
|
||||
_sub_plugins |= nonebot.load_plugins(str((Path(__file__).parent / "plugins").resolve()))
|
0
tests/plugins/nested/plugins/nested_subplugin.py
Normal file
0
tests/plugins/nested/plugins/nested_subplugin.py
Normal file
@ -1,8 +1,7 @@
|
||||
from nonebot import require
|
||||
from plugins.export import test
|
||||
|
||||
from .export import test as test_related
|
||||
|
||||
test_require = require("export").test
|
||||
|
||||
assert test is test_related and test is test_require, "Export Require Error"
|
||||
from plugins.export import test
|
||||
|
||||
assert test is test_require and test() == "export", "Export Require Error"
|
||||
|
Reference in New Issue
Block a user