# Tox (https://tox.readthedocs.io/) is a tool for running tests # in multiple virtualenvs. This configuration file will run the # tests suite on all supported python versions. To use it, "pip install tox" # and then run "tox" from this directory. [tox] envlist = py311 toxworkdir={toxinidir}/.tox [testenv] deps = # Zależności z pyproject.toml python-telegram-bot[job-queue] >= 20.0 pytube >= 15.0.0 openai >= 1.0.0 asyncpg >= 0.27.0 python-dotenv >= 1.0.0 httpx >= 0.24.0 aiohttp >= 3.9.0 # Zależności testowe pytest pytest-asyncio pytest-cov pass_env = OPENAI_API_KEY TELEGRAM_BOT_TOKEN DATABASE_URL YOUTUBE_TRANSCRIPT_API_TOKEN commands = python ./main.py [testenv:unit-tests] deps = # Zależności z pyproject.toml python-telegram-bot[job-queue] >= 20.0 pytube >= 15.0.0 openai >= 1.0.0 asyncpg >= 0.27.0 python-dotenv >= 1.0.0 httpx >= 0.24.0 aiohttp >= 3.9.0 # Zależności testowe pytest pytest-asyncio pytest-cov pass_env = OPENAI_API_KEY TELEGRAM_BOT_TOKEN DATABASE_URL YOUTUBE_TRANSCRIPT_API_TOKEN commands = # Uruchamianie testów jednostkowych używając pytest-asyncio zamiast unittest # aby poprawnie obsługiwać testy asynchroniczne python -m pytest tests/ -k "not integration and not slow" [testenv:integration-tests] deps = # Zależności z pyproject.toml python-telegram-bot[job-queue] >= 20.0 pytube >= 15.0.0 openai >= 1.0.0 asyncpg >= 0.27.0 python-dotenv >= 1.0.0 httpx >= 0.24.0 aiohttp >= 3.9.0 # Zależności testowe pytest pytest-asyncio pytest-cov setenv = # Konfiguracja logowania dla testów PYTHONASYNCIODEBUG = 1 # Pomaga w wykrywaniu problemów z asynchronicznym kodem PYTHONFAULTHANDLER = 1 # Pomaga w diagnozowaniu segmentation faults pass_env = OPENAI_API_KEY TELEGRAM_BOT_TOKEN DATABASE_URL YOUTUBE_TRANSCRIPT_API_TOKEN commands = # Sprawdzenie zmiennych środowiskowych przed uruchomieniem testów python tests/check_env.py # Uruchamianie testów integracyjnych z rozszerzonym logowaniem python -m pytest tests/test_real_integration.py -v --log-cli-level=DEBUG [testenv:all-tests] deps = # Zależności z pyproject.toml python-telegram-bot[job-queue] >= 20.0 pytube >= 15.0.0 openai >= 1.0.0 asyncpg >= 0.27.0 python-dotenv >= 1.0.0 httpx >= 0.24.0 aiohttp >= 3.9.0 # Zależności testowe pytest pytest-asyncio pytest-cov setenv = # Konfiguracja logowania dla testów PYTHONASYNCIODEBUG = 1 PYTHONFAULTHANDLER = 1 pass_env = OPENAI_API_KEY TELEGRAM_BOT_TOKEN DATABASE_URL YOUTUBE_TRANSCRIPT_API_TOKEN commands = # Sprawdzenie zmiennych środowiskowych przed uruchomieniem testów python tests/check_env.py # Uruchamianie wszystkich testów python -m pytest tests/ --log-cli-level=INFO [testenv:cov] deps = # Zależności z pyproject.toml python-telegram-bot[job-queue] >= 20.0 pytube >= 15.0.0 openai >= 1.0.0 asyncpg >= 0.27.0 python-dotenv >= 1.0.0 httpx >= 0.24.0 aiohttp >= 3.9.0 # Zależności testowe pytest pytest-asyncio pytest-cov pass_env = OPENAI_API_KEY TELEGRAM_BOT_TOKEN DATABASE_URL YOUTUBE_TRANSCRIPT_API_TOKEN commands = # Uruchamianie testów z pokryciem kodu python -m pytest --cov=src tests/ --log-cli-level=INFO