Skip to content

feat: 测试插件是否在 import 前使用 require 声明依赖#115

Merged
he0119 merged 1 commit intomainfrom
feat/require-test
Mar 16, 2023
Merged

feat: 测试插件是否在 import 前使用 require 声明依赖#115
he0119 merged 1 commit intomainfrom
feat/require-test

Conversation

@he0119
Copy link
Copy Markdown
Member

@he0119 he0119 commented Mar 16, 2023

加载插件后,require 其依赖来测试是否符合标准。

from nonebot import init, load_plugin, require

init(driver="~none")
valid = load_plugin("nonebot_plugin_xxx")
require("nonebot_plugin_yyy")

if not valid:
    exit(1)
else:
    exit(0)

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2023

Codecov Report

Merging #115 (c47021a) into main (f2e8770) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #115   +/-   ##
=======================================
  Coverage   94.10%   94.10%           
=======================================
  Files           6        6           
  Lines         526      526           
=======================================
  Hits          495      495           
  Misses         31       31           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@he0119 he0119 merged commit 16cba21 into main Mar 16, 2023
@he0119 he0119 deleted the feat/require-test branch March 16, 2023 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants