Skip to content

Commit

Permalink
💄 auto fix by pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Aug 15, 2024
1 parent 9863090 commit 709aebd
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion tests/config/test_config_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from nonebot_bison.config.config_legacy import Config


@pytest.fixture
@pytest.fixture()
def config_legacy(app: App, use_legacy_config):
from nonebot_bison.config import config_legacy as config

Expand Down
8 changes: 4 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def load_adapters(nonebug_init: None):
return driver


@pytest.fixture
@pytest.fixture()
async def app(tmp_path: Path, request: pytest.FixtureRequest, mocker: MockerFixture):
sys.path.append(str(Path(__file__).parent.parent / "src" / "plugins"))

Expand Down Expand Up @@ -75,7 +75,7 @@ async def app(tmp_path: Path, request: pytest.FixtureRequest, mocker: MockerFixt
cache_dir.mkdir()


@pytest.fixture
@pytest.fixture()
def dummy_user_subinfo(app: App):
from nonebot_plugin_saa import TargetQQGroup

Expand All @@ -85,14 +85,14 @@ def dummy_user_subinfo(app: App):
return UserSubInfo(user=user, categories=[], tags=[])


@pytest.fixture
@pytest.fixture()
async def init_scheduler(app: App):
from nonebot_bison.scheduler.manager import init_scheduler

return await init_scheduler()


@pytest.fixture
@pytest.fixture()
async def use_legacy_config(app: App):
import aiofiles

Expand Down
2 changes: 1 addition & 1 deletion tests/platforms/test_arknights.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .utils import get_file, get_json


@pytest.fixture
@pytest.fixture()
def arknights(app: App):
from nonebot_bison.platform import platform_manager
from nonebot_bison.utils import ProcessContext, DefaultClientManager
Expand Down
6 changes: 3 additions & 3 deletions tests/platforms/test_bilibili.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .utils import get_json


@pytest.fixture
@pytest.fixture()
def bing_dy_list(app: App):
from nonebot_bison.platform.bilibili.models import PostAPI

Expand All @@ -26,7 +26,7 @@ def bing_dy_list(app: App):
from nonebot_bison.platform.bilibili import Bilibili


@pytest.fixture
@pytest.fixture()
def bilibili(app: App) -> "Bilibili":
from nonebot_bison.utils import ProcessContext
from nonebot_bison.platform import platform_manager
Expand All @@ -35,7 +35,7 @@ def bilibili(app: App) -> "Bilibili":
return platform_manager["bilibili"](ProcessContext(BilibiliClientManager())) # type: ignore


@pytest.fixture
@pytest.fixture()
def without_dynamic(app: App):
from nonebot_bison.platform.bilibili.models import PostAPI

Expand Down
2 changes: 1 addition & 1 deletion tests/platforms/test_bilibili_bangumi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from nonebot_bison.platform.bilibili import BilibiliBangumi


@pytest.fixture
@pytest.fixture()
def bili_bangumi(app: App):
from nonebot_bison.platform import platform_manager
from nonebot_bison.utils import ProcessContext, DefaultClientManager
Expand Down
10 changes: 5 additions & 5 deletions tests/platforms/test_bilibili_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
from nonebot_bison.platform.bilibili import Bilibililive


@pytest.fixture
@pytest.fixture()
def bili_live(app: App):
from nonebot_bison.platform import platform_manager
from nonebot_bison.utils import ProcessContext, DefaultClientManager

return platform_manager["bilibili-live"](ProcessContext(DefaultClientManager()))


@pytest.fixture
@pytest.fixture()
def dummy_only_open_user_subinfo(app: App):
from nonebot_plugin_saa import TargetQQGroup

Expand Down Expand Up @@ -131,7 +131,7 @@ async def test_fetch_bililive_only_live_open(bili_live: "Bilibililive", dummy_on
assert len(res4[0][1]) == 0


@pytest.fixture
@pytest.fixture()
def dummy_only_title_user_subinfo(app: App):
from nonebot_plugin_saa import TargetQQGroup

Expand Down Expand Up @@ -190,7 +190,7 @@ async def test_fetch_bililive_only_title_change(bili_live, dummy_only_title_user
assert len(res4[0][1]) == 0


@pytest.fixture
@pytest.fixture()
def dummy_only_close_user_subinfo(app: App):
from nonebot_plugin_saa import TargetQQGroup

Expand Down Expand Up @@ -250,7 +250,7 @@ async def test_fetch_bililive_only_close(bili_live, dummy_only_close_user_subinf
assert post4.compress is True


@pytest.fixture
@pytest.fixture()
def dummy_bililive_user_subinfo(app: App):
from nonebot_plugin_saa import TargetQQGroup

Expand Down
4 changes: 2 additions & 2 deletions tests/platforms/test_ceobecanteen.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from nonebot_bison.platform.ceobecanteen import CeobeCanteen


@pytest.fixture
@pytest.fixture()
def dummy_only_open_user_subinfo(app: App):
from nonebot_plugin_saa import TargetQQGroup

Expand All @@ -22,7 +22,7 @@ def dummy_only_open_user_subinfo(app: App):
return UserSubInfo(user=user, categories=[1], tags=[])


@pytest.fixture
@pytest.fixture()
def ceobecanteen(app: App):
from nonebot_bison.utils import ProcessContext
from nonebot_bison.platform import platform_manager
Expand Down
2 changes: 1 addition & 1 deletion tests/platforms/test_ff14.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .utils import get_json


@pytest.fixture
@pytest.fixture()
def ff14(app: App):
from nonebot_bison.platform import platform_manager
from nonebot_bison.utils import ProcessContext, DefaultClientManager
Expand Down
2 changes: 1 addition & 1 deletion tests/platforms/test_ncm_artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from nonebot_bison.platform.ncm import NcmArtist


@pytest.fixture
@pytest.fixture()
def ncm_artist(app: App):
from nonebot_bison.platform import platform_manager
from nonebot_bison.utils import ProcessContext, DefaultClientManager
Expand Down
2 changes: 1 addition & 1 deletion tests/platforms/test_ncm_radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from nonebot_bison.platform.ncm import NcmRadio


@pytest.fixture
@pytest.fixture()
def ncm_radio(app: App):
from nonebot_bison.platform import platform_manager
from nonebot_bison.utils import ProcessContext, DefaultClientManager
Expand Down
16 changes: 8 additions & 8 deletions tests/platforms/test_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
]


@pytest.fixture
@pytest.fixture()
def dummy_user(app: App):
from nonebot_plugin_saa import TargetQQGroup

user = TargetQQGroup(group_id=123)
return user


@pytest.fixture
@pytest.fixture()
def user_info_factory(app: App, dummy_user):
from nonebot_bison.types import UserSubInfo

Expand All @@ -34,7 +34,7 @@ def _user_info(category_getter, tag_getter):
return _user_info


@pytest.fixture
@pytest.fixture()
def mock_platform_without_cats_tags(app: App):
from nonebot_bison.post import Post
from nonebot_bison.types import Target, RawPost
Expand Down Expand Up @@ -81,7 +81,7 @@ async def get_sub_list(cls, _: "Target"):
return MockPlatform


@pytest.fixture
@pytest.fixture()
def mock_platform(app: App):
from nonebot_bison.post import Post
from nonebot_bison.utils import Site
Expand Down Expand Up @@ -143,7 +143,7 @@ async def get_sub_list(cls, _: "Target"):
return MockPlatform


@pytest.fixture
@pytest.fixture()
def mock_site(app):
from nonebot_bison.utils import Site

Expand All @@ -155,7 +155,7 @@ class MockSite(Site):
return MockSite


@pytest.fixture
@pytest.fixture()
def mock_platform_no_target(app: App, mock_site):
from nonebot_bison.post import Post
from nonebot_bison.types import Tag, Target, RawPost, Category
Expand Down Expand Up @@ -210,7 +210,7 @@ async def get_sub_list(cls, _: "Target"):
return MockPlatform


@pytest.fixture
@pytest.fixture()
def mock_platform_no_target_2(app: App, mock_site):
from nonebot_bison.post import Post
from nonebot_bison.platform.platform import NewMessage
Expand Down Expand Up @@ -272,7 +272,7 @@ async def get_sub_list(cls, _: "Target"):
return MockPlatform


@pytest.fixture
@pytest.fixture()
def mock_status_change(app: App):
from nonebot_bison.post import Post
from nonebot_bison.platform.platform import StatusChange
Expand Down
2 changes: 1 addition & 1 deletion tests/platforms/test_weibo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
image_cdn_router = respx.route(host__regex=r"wx\d.sinaimg.cn", path__startswith="/large/")


@pytest.fixture
@pytest.fixture()
def weibo(app: App):
from nonebot_bison.platform import platform_manager
from nonebot_bison.utils import ProcessContext, DefaultClientManager
Expand Down
2 changes: 1 addition & 1 deletion tests/post/test_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
]


@pytest.fixture
@pytest.fixture()
def mock_platform(app: App):
from nonebot_bison.post import Post
from nonebot_bison.types import Target, RawPost
Expand Down
4 changes: 2 additions & 2 deletions tests/test_merge_pic.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ async def download_imgs(url_list: list[str]) -> list[bytes]:
return img_contents


@pytest.fixture
@pytest.fixture()
async def downloaded_resource():
return await download_imgs(merge_source_9)


@pytest.fixture
@pytest.fixture()
async def downloaded_resource_2():
return await download_imgs(merge_source_9_2)

Expand Down
8 changes: 4 additions & 4 deletions tests/theme/test_themes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
]


@pytest.fixture
@pytest.fixture()
def MERGEABLE_PNG_DATA() -> bytes:
from tests.platforms.utils import get_bytes

return get_bytes("mergeable-pic.jpg")


@pytest.fixture
@pytest.fixture()
def SIMPLE_PNG_DATA() -> bytes:
return b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x06\x00\x00\x00\x1f\x15\xc4\x89"


@pytest.fixture
@pytest.fixture()
def mock_platform(app: App):
from nonebot_bison.post import Post
from nonebot_bison.types import Target, RawPost
Expand Down Expand Up @@ -81,7 +81,7 @@ async def get_sub_list(cls, _: "Target"):
return MockPlatform


@pytest.fixture
@pytest.fixture()
def mock_post(app: App, mock_platform):
from nonebot_bison.post import Post
from nonebot_bison.utils import ProcessContext, DefaultClientManager
Expand Down

0 comments on commit 709aebd

Please sign in to comment.