This directory contains the test suite for the MCP Data Server project.
test_server.py- Unit tests for server functions, utilities, and componentstest_integration.py- Integration tests for end-to-end query executionconftest.py- Pytest fixtures and configuration__init__.py- Package initialization
pytest tests/pytest tests/ -vpytest tests/test_server.pypytest tests/test_server.py::TestFileLoading::test_load_text_file_existspytest tests/ --cov=. --cov-report=html- File loading and parsing utilities
- SQL parsing from markdown
- Database isolation and connection handling
- Query execution and result formatting
- Data catalog parsing
- MCP resource and prompt functions
- Error handling
- End-to-end query execution
- Database extensions (spatial, httpfs)
- Error recovery scenarios
- Performance and result limiting
- Tests are designed to be resilient to changes in markdown file content
- Mock fixtures are used where appropriate to avoid hard dependencies
- Some tests may skip if certain DuckDB extensions are unavailable
- Tests assume DuckDB and required dependencies are installed
Install test dependencies:
pip install pytest pytest-covOr if using the project's virtual environment, the dependencies should already be installed.