mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 09:37:30 +00:00
233e7ab58d
Co-authored-by: luoshuijs <luoshuijs@outlook.com> Co-authored-by: Karako <karakohear@gmail.com> Co-authored-by: xtaodada <xtao@xtaolink.cn>
28 lines
556 B
Python
28 lines
556 B
Python
import asyncio
|
|
|
|
import pytest
|
|
import pytest_asyncio
|
|
|
|
from core.config import config
|
|
from core.dependence.mysql import MySQL
|
|
from core.dependence.redisdb import RedisDB
|
|
|
|
|
|
@pytest_asyncio.fixture(scope="session")
|
|
def event_loop():
|
|
policy = asyncio.get_event_loop_policy()
|
|
res = policy.new_event_loop()
|
|
asyncio.set_event_loop(res)
|
|
yield res
|
|
res.close()
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def mysql():
|
|
return MySQL.from_config(config=config)
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def redis():
|
|
return RedisDB.from_config(config=config)
|