Spaces:
Sleeping
Sleeping
Download tests/deprecated/test_dependencies.py from purecipher/xsecuremcp: direct link, hf CLI and curl.
- Browser
- Download file 965 Bytes
-
https://huggingface.co/spaces/purecipher/xsecuremcp/resolve/main/tests/deprecated/test_dependencies.py
- Command line
-
hf download hf://spaces/purecipher/xsecuremcp/tests/deprecated/test_dependencies.py
-
curl -L -o test_dependencies.py https://huggingface.co/spaces/purecipher/xsecuremcp/resolve/main/tests/deprecated/test_dependencies.py
965 Bytes
| """Tests for deprecated dependencies parameter. | |
| This entire file can be deleted when the dependencies parameter is removed (deprecated in v2.11.4). | |
| """ | |
| import warnings | |
| import pytest | |
| from fastmcp import FastMCP | |
| def test_dependencies_parameter_deprecated(): | |
| """Test that using the dependencies parameter raises a deprecation warning.""" | |
| with pytest.warns(DeprecationWarning, match="deprecated as of FastMCP 2.11.4"): | |
| server = FastMCP("Test Server", dependencies=["pandas", "numpy"]) | |
| # Should still work for backward compatibility | |
| assert server.dependencies == ["pandas", "numpy"] | |
| def test_no_warning_without_dependencies(): | |
| """Test that no warning is raised when dependencies are not used.""" | |
| with warnings.catch_warnings(): | |
| warnings.simplefilter("error") # Turn warnings into errors | |
| server = FastMCP("Test Server") # Should not raise | |
| assert server.dependencies == [] # Should use default empty list | |