mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-04 04:32:06 +08:00
* ➕ 添加测试依赖 nonebug * ➕ 添加测试依赖 pytest-asyncio * 🔧 配置 pytest * 🙈 更新 .gitignore * ➕ 添加 test 依赖 pytest-cov * 🔧 配置 pytest * ✅ 添加测试 * 👷 添加 Test CI * 💚 暂时移除 3.13 的测试
22 lines
662 B
Python
22 lines
662 B
Python
import os
|
|
|
|
import nonebot
|
|
import pytest
|
|
from nonebot.adapters.onebot.v11 import Adapter as OnebotV11Adapter
|
|
from nonebug import NONEBOT_INIT_KWARGS, NONEBOT_START_LIFESPAN # type: ignore[import-untyped]
|
|
|
|
os.environ['ENVIRONMENT'] = 'test'
|
|
|
|
|
|
def pytest_configure(config: pytest.Config) -> None:
|
|
config.stash[NONEBOT_INIT_KWARGS] = {'log_level': 'DEBUG'}
|
|
config.stash[NONEBOT_START_LIFESPAN] = False
|
|
|
|
|
|
@pytest.fixture(scope='session', autouse=True)
|
|
async def after_nonebot_init(after_nonebot_init: None) -> None: # noqa: ARG001
|
|
driver = nonebot.get_driver()
|
|
driver.register_adapter(OnebotV11Adapter)
|
|
|
|
nonebot.load_from_toml('pyproject.toml')
|