File tree Expand file tree Collapse file tree 3 files changed +41
-2
lines changed
Expand file tree Collapse file tree 3 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 4646 - name : Install FastMCP
4747 run : uv sync --locked
4848
49- - name : Run tests
50- run : uv run pytest tests
49+ - name : Run tests (excluding integration)
50+ run : uv run pytest tests -m "not integration"
51+
52+ run_integration_tests :
53+ name : " Run integration tests"
54+ runs-on : ubuntu-latest
55+ timeout-minutes : 10
56+
57+ steps :
58+ - uses : actions/checkout@v4
59+
60+ - name : Install uv
61+ uses : astral-sh/setup-uv@v6
62+ with :
63+ enable-cache : true
64+ cache-dependency-glob : " uv.lock"
65+ python-version : " 3.10"
66+
67+ - name : Install FastMCP
68+ run : uv sync --locked
69+
70+ - name : Run integration tests
71+ run : uv run pytest tests -m "integration"
5172 env :
5273 FASTMCP_GITHUB_TOKEN : ${{ secrets.FASTMCP_GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -101,6 +101,15 @@ env = [
101101 ' D:FASTMCP_LOG_LEVEL=DEBUG' ,
102102 ' D:FASTMCP_ENABLE_RICH_TRACEBACKS=0' ,
103103]
104+ markers = [
105+ " integration: marks tests as integration tests (deselect with '-m \" not integration\" ')" ,
106+ ]
107+ # Automatically mark all tests in integration_tests folder
108+ pythonpath = [" ." ]
109+ testpaths = [" tests" ]
110+ python_files = [" test_*.py" , " *_test.py" ]
111+ python_classes = [" Test*" ]
112+ python_functions = [" test_*" ]
104113
105114[tool .pyright ]
106115include = [" src" , " tests" ]
Original file line number Diff line number Diff line change 1+ import pytest
2+
3+
4+ def pytest_collection_modifyitems (items ):
5+ """Automatically mark tests in integration_tests folder with 'integration' marker."""
6+ for item in items :
7+ # Check if the test is in the integration_tests folder
8+ if "integration_tests" in str (item .fspath ):
9+ item .add_marker (pytest .mark .integration )
You can’t perform that action at this time.
0 commit comments