File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 11import socket
22from collections .abc import Callable
3+ from pathlib import Path
34from typing import Any
45
56import pytest
67
8+ from fastmcp .utilities .tests import temporary_settings
9+
710
811def pytest_collection_modifyitems (items ):
912 """Automatically mark tests in integration_tests folder with 'integration' marker."""
@@ -21,6 +24,20 @@ def import_rich_rule():
2124 yield
2225
2326
27+ @pytest .fixture (autouse = True )
28+ def isolate_settings_home (tmp_path : Path ):
29+ """Ensure each test uses an isolated settings.home directory.
30+
31+ This prevents SQLite database locking issues on Windows when multiple
32+ tests share the same DiskStore directory in settings.home / "oauth-proxy".
33+ """
34+ test_home = tmp_path / "fastmcp-test-home"
35+ test_home .mkdir (exist_ok = True )
36+
37+ with temporary_settings (home = test_home ):
38+ yield
39+
40+
2441def get_fn_name (fn : Callable [..., Any ]) -> str :
2542 return fn .__name__ # ty: ignore[unresolved-attribute]
2643
You can’t perform that action at this time.
0 commit comments