Commit 77b6547
committed
fix(tests): skip mcp server tests when mcp unavailable/incompatible
test_mcp_server.py imported fpb_mcp_server unconditionally, which hard-
exits (sys.exit(1)) at import time when the optional mcp package is
missing or its API is incompatible. mcp 2.0 removed the
mcp.server.fastmcp import path, so a fresh CI install (unpinned 'pip
install mcp' -> 2.0) crashed all 49 tests with SystemExit.
Probe fpb_mcp_server importability once and apply a module-level
pytest.mark.skipif, catching both ImportError (missing) and SystemExit
(the module's own import guard). mcp 1.x still runs the full suite;
mcp 2.0/missing now skips gracefully instead of failing.
Change-Id: Icb488fc29307e610f60b5d84b48a07cfe72220fb1 parent 1a18188 commit 77b6547
1 file changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
12 | 35 | | |
13 | 36 | | |
14 | 37 | | |
| |||
0 commit comments