Skip to content

Commit cd64a35

Browse files
authored
fix: ensure config file in test dir (#95)
1 parent 4f8b616 commit cd64a35

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ ignore = [
114114

115115
[tool.ruff.lint.per-file-ignores]
116116
"tests/*" = ["S101", "S106", "SIM117"]
117+
"tests/conftest.py" = ["E402"]
117118

118119
[tool.ruff.format]
119120
preview = true

tests/conftest.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
from __future__ import annotations
22

3-
import asyncio
3+
from pathlib import Path
4+
5+
_HERE = Path(__file__).resolve().parent
6+
47
import os
8+
9+
os.environ["MCP_EMAIL_SERVER_CONFIG_PATH"] = (_HERE / "config.toml").as_posix()
10+
os.environ["MCP_EMAIL_SERVER_LOG_LEVEL"] = "DEBUG"
11+
12+
import asyncio
513
from datetime import datetime
6-
from pathlib import Path
714
from unittest.mock import AsyncMock
815

916
import pytest
1017

1118
from mcp_email_server.config import EmailServer, EmailSettings, ProviderSettings, delete_settings
1219

13-
_HERE = Path(__file__).resolve().parent
14-
15-
os.environ["MCP_EMAIL_SERVER_CONFIG_PATH"] = (_HERE / "config.toml").as_posix()
16-
os.environ["MCP_EMAIL_SERVER_LOG_LEVEL"] = "DEBUG"
17-
1820

1921
@pytest.fixture(autouse=True)
2022
def patch_env(monkeypatch: pytest.MonkeyPatch, tmp_path: pytest.TempPathFactory):

0 commit comments

Comments
 (0)