mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-06 20:16:47 +00:00
🚨 Develop: 完全使用 ruff 替代 isort 与 black (#3151)
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from functools import wraps
|
||||
from dataclasses import asdict
|
||||
from typing import TypeVar, Callable
|
||||
from functools import wraps
|
||||
from pathlib import Path
|
||||
import sys
|
||||
from typing import Callable, TypeVar
|
||||
from typing_extensions import ParamSpec
|
||||
|
||||
import pytest
|
||||
@ -11,8 +11,8 @@ import nonebot
|
||||
from nonebot.plugin import (
|
||||
Plugin,
|
||||
PluginManager,
|
||||
_plugins,
|
||||
_managers,
|
||||
_plugins,
|
||||
inherit_supported_adapters,
|
||||
)
|
||||
|
||||
@ -21,7 +21,6 @@ R = TypeVar("R")
|
||||
|
||||
|
||||
def _recover(func: Callable[P, R]) -> Callable[P, R]:
|
||||
|
||||
@wraps(func)
|
||||
def _wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
|
||||
origin_managers = _managers.copy()
|
||||
|
@ -4,18 +4,18 @@ import pytest
|
||||
|
||||
import nonebot
|
||||
from nonebot.adapters import Event
|
||||
from nonebot.typing import T_RuleChecker
|
||||
from nonebot.matcher import Matcher, matchers
|
||||
from nonebot.rule import (
|
||||
RegexRule,
|
||||
IsTypeRule,
|
||||
CommandRule,
|
||||
EndswithRule,
|
||||
KeywordsRule,
|
||||
FullmatchRule,
|
||||
StartswithRule,
|
||||
IsTypeRule,
|
||||
KeywordsRule,
|
||||
RegexRule,
|
||||
ShellCommandRule,
|
||||
StartswithRule,
|
||||
)
|
||||
from nonebot.typing import T_RuleChecker
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@ -109,12 +109,12 @@ def test_on(
|
||||
import plugins.plugin.matchers as module
|
||||
from plugins.plugin.matchers import (
|
||||
TestEvent,
|
||||
expire_time,
|
||||
handler,
|
||||
permission,
|
||||
priority,
|
||||
rule,
|
||||
state,
|
||||
handler,
|
||||
priority,
|
||||
permission,
|
||||
expire_time,
|
||||
)
|
||||
|
||||
matcher = getattr(module, matcher_name)
|
||||
|
Reference in New Issue
Block a user