mirror of
https://github.com/Balshgit/mosgortrans.git
synced 2026-02-03 11:20:56 +03:00
add pytest to sys PATH
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from aiogram import Dispatcher
|
||||
from aiogram.utils.executor import start_polling, start_webhook
|
||||
from core.bot import bot, dispatcher, driver
|
||||
from core.bot import bot, dispatcher
|
||||
from core.logger import logger
|
||||
from core.scheduler import asyncio_schedule
|
||||
from settings import (
|
||||
@@ -24,8 +24,6 @@ async def on_shutdown(dp: Dispatcher) -> None:
|
||||
await bot.delete_webhook()
|
||||
|
||||
# Close DB connection (if used)
|
||||
if driver:
|
||||
driver.close()
|
||||
await dp.storage.close()
|
||||
await dp.storage.wait_closed()
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import asyncio
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import aresponses
|
||||
@@ -8,6 +10,9 @@ from aiogram import Bot
|
||||
BOT_ID = 123456789
|
||||
TOKEN = f'{BOT_ID}:AABBCCDDEEFFaabbccddeeff-1234567890'
|
||||
|
||||
# include pytest directory in PATH
|
||||
sys.path.append(Path(__file__).parent.parent.as_posix())
|
||||
|
||||
|
||||
class FakeTelegram(aresponses.ResponsesMockServer):
|
||||
def __init__(
|
||||
|
||||
Reference in New Issue
Block a user