mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-06 07:50:32 +00:00
Update tests and small refactoring
This commit is contained in:
parent
65331e1fda
commit
7dc2a0ddaf
10 changed files with 18 additions and 15 deletions
20
Makefile
20
Makefile
|
|
@ -1,6 +1,8 @@
|
|||
.DEFAULT_GOAL := help
|
||||
|
||||
python := python3.7
|
||||
base_python := python3.7
|
||||
py := poetry run
|
||||
python := $(py) python
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
|
|
@ -32,7 +34,7 @@ help:
|
|||
|
||||
.PHONY: install
|
||||
install:
|
||||
$(python) -m pip install --user -U poetry
|
||||
$(base_python) -m pip install --user -U poetry
|
||||
poetry install
|
||||
|
||||
.PHONY: clean
|
||||
|
|
@ -53,19 +55,19 @@ clean:
|
|||
|
||||
.PHONY: isort
|
||||
isort:
|
||||
poetry run isort -rc aiogram tests
|
||||
$(py) isort -rc aiogram tests
|
||||
|
||||
.PHONY: black
|
||||
black:
|
||||
poetry run black aiogram tests
|
||||
$(py) black aiogram tests
|
||||
|
||||
.PHONY: flake8
|
||||
flake8:
|
||||
poetry run flake8 aiogram tests
|
||||
$(py) flake8 aiogram tests
|
||||
|
||||
.PHONY: mypy
|
||||
mypy:
|
||||
poetry run mypy aiogram tests
|
||||
$(py) mypy aiogram tests
|
||||
|
||||
.PHONY: lint
|
||||
lint: isort black flake8 mypy
|
||||
|
|
@ -77,7 +79,7 @@ lint: isort black flake8 mypy
|
|||
|
||||
.PHONY: test
|
||||
test:
|
||||
poetry run pytest --cov=aiogram --cov-config .coveragerc tests/ -sq
|
||||
$(py) pytest --cov=aiogram --cov-config .coveragerc tests/ -sq
|
||||
|
||||
|
||||
# =================================================================================================
|
||||
|
|
@ -86,8 +88,8 @@ test:
|
|||
|
||||
.PHONY: docs
|
||||
docs:
|
||||
mkdocs build
|
||||
$(py) mkdocs build
|
||||
|
||||
.PHONY: docs-serve
|
||||
docs-serve:
|
||||
mkdocs serve
|
||||
$(py) mkdocs serve
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from .api import methods, session, types
|
||||
from .api import methods, types
|
||||
from .api.client import session
|
||||
from .api.client.bot import Bot
|
||||
|
||||
__all__ = ["__api_version__", "__version__", "types", "methods", "Bot", "session"]
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from typing import TypeVar
|
|||
|
||||
from ...utils.mixins import ContextInstanceMixin
|
||||
from ..methods import TelegramMethod
|
||||
from ..session.aiohttp import AiohttpSession
|
||||
from ..session.base import BaseSession
|
||||
from aiogram.api.client.session.aiohttp import AiohttpSession
|
||||
from aiogram.api.client.session.base import BaseSession
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from typing import Callable, Optional, TypeVar, cast
|
|||
|
||||
from aiohttp import ClientSession, FormData
|
||||
|
||||
from ..methods import Request, TelegramMethod
|
||||
from aiogram.api.methods import Request, TelegramMethod
|
||||
from .base import PRODUCTION, BaseSession, TelegramAPIServer
|
||||
|
||||
T = TypeVar("T")
|
||||
0
tests/test_api/test_client/test_session/__init__.py
Normal file
0
tests/test_api/test_client/test_session/__init__.py
Normal file
|
|
@ -1,4 +1,4 @@
|
|||
from aiogram.api.session.base import PRODUCTION
|
||||
from aiogram.api.client.session.base import PRODUCTION
|
||||
|
||||
|
||||
class TestAPIServer:
|
||||
|
|
@ -4,7 +4,7 @@ from unittest.mock import patch
|
|||
import pytest
|
||||
from asynctest import CoroutineMock
|
||||
|
||||
from aiogram.api.session.base import BaseSession
|
||||
from aiogram.api.client.session.base import BaseSession
|
||||
from aiogram.utils.mixins import DataMixin
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue