From 0b8a229c55a29685ea8f7ddec47bab8f8195f4dc Mon Sep 17 00:00:00 2001 From: Joe Cardoso Date: Fri, 20 Mar 2026 10:01:08 -0300 Subject: [PATCH] fix: load .env in integration test conftest Add python-dotenv to dev dependencies and call load_dotenv() in tests-integration/conftest.py so .env files are picked up automatically before the API key gate runs. --- pyproject.toml | 1 + tests-integration/conftest.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 15dc3b8..ca6bdfe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,6 +61,7 @@ dev = [ "pytest>=8.4.0", "pytest-asyncio>=0.24.0", "pytest-cov>=6.0.0", + "python-dotenv>=1.0.0", "ruff>=0.13.0", "ty>=0.0.20", ] diff --git a/tests-integration/conftest.py b/tests-integration/conftest.py index 31d7393..c0eda8e 100644 --- a/tests-integration/conftest.py +++ b/tests-integration/conftest.py @@ -9,9 +9,12 @@ import pytest import pytest_asyncio +from dotenv import load_dotenv from mcp_example.api_client import ExampleClient +load_dotenv() + def pytest_configure(config): """Check for required environment variables before running tests."""