Dev 6 #9

Merged
KerradKerridi merged 13 commits from dev-6 into master 2025-08-30 11:58:45 +00:00
4 changed files with 29 additions and 19 deletions
Showing only changes of commit e17a9f9c29 - Show all commits

24
pyproject.toml Normal file
View File

@@ -0,0 +1,24 @@
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-v",
"--tb=short",
"--strict-markers",
"--disable-warnings",
"--asyncio-mode=auto"
]
asyncio_default_fixture = "event_loop"
asyncio_default_fixture_loop_scope = "function"
markers = [
"asyncio: marks tests as async (deselect with '-m \"not asyncio\"')",
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests"
]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning"
]

View File

@@ -1,19 +0,0 @@
[tool:pytest]
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
addopts =
-v
--tb=short
--strict-markers
--disable-warnings
--asyncio-mode=auto
markers =
asyncio: marks tests as async (deselect with '-m "not asyncio"')
slow: marks tests as slow (deselect with '-m "not slow"')
integration: marks tests as integration tests
unit: marks tests as unit tests
filterwarnings =
ignore::DeprecationWarning
ignore::PendingDeprecationWarning

View File

@@ -11,6 +11,9 @@ from database.db import BotDB
# Импортируем моки в самом начале # Импортируем моки в самом начале
import tests.mocks import tests.mocks
# Настройка pytest-asyncio
pytest_plugins = ('pytest_asyncio',)
@pytest.fixture(scope="session") @pytest.fixture(scope="session")
def event_loop(): def event_loop():

View File

@@ -2,6 +2,7 @@
""" """
Тестовый скрипт для проверки модуля мониторинга сервера Тестовый скрипт для проверки модуля мониторинга сервера
""" """
import pytest
import asyncio import asyncio
import sys import sys
import os import os
@@ -23,6 +24,7 @@ class MockBot:
print(f"{'='*60}\n") print(f"{'='*60}\n")
@pytest.mark.asyncio
async def test_monitor(): async def test_monitor():
"""Тестирование модуля мониторинга""" """Тестирование модуля мониторинга"""
print("🧪 Тестирование модуля мониторинга сервера") print("🧪 Тестирование модуля мониторинга сервера")