Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

Fall back to pure Python YAML loader in schema tests (#5395)

Jeremiah Lowinc3b81662d31a
diff --git a/tests/utilities/json_schema_type/test_real_world_schemas.py b/tests/utilities/json_schema_type/test_real_world_schemas.py
index 9d2b975c1..d5122088f 100644
--- a/tests/utilities/json_schema_type/test_real_world_schemas.py
+++ b/tests/utilities/json_schema_type/test_real_world_schemas.py
@@ -65,7 +65,12 @@ from pathlib import Path
import pytest
import yaml
from pydantic import TypeAdapter
-from yaml import CSafeLoader # ty: ignore[possibly-missing-import]
+from yaml import SafeLoader
+
+try:
+ from yaml import CSafeLoader # ty: ignore[possibly-missing-import]
+except ImportError:
+ CSafeLoader = SafeLoader
from fastmcp.utilities.json_schema_type import json_schema_to_type