# Run all tests
./run-tests.sh
# Run with coverage report
./run-tests.sh coverage
# Run specific test file
./run-tests.sh tests/test_models.py- 151 tests - 100% passing β
- 99% coverage - 238/239 lines covered
- ~1.1s execution time
tests/
βββ conftest.py # Shared fixtures
βββ test_models.py # Domain models (30 tests)
βββ test_api_client.py # HTTP client (28 tests)
βββ test_search_service.py # Search logic (31 tests)
βββ test_translator_service.py # Translation (18 tests)
βββ test_formatters.py # Formatting (33 tests)
βββ test_server_integration.py # MCP tools (18 tests)
./run-tests.sh./run-tests.sh unit./run-tests.sh integration./run-tests.sh coverage
# Generates coverage.xml (for CI/CD tools like Codecov, SonarQube)docker-compose run --rm techword-mcp pytest tests/test_models.py::TestWord -v# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -e ".[dev]"
# Run tests
pytest -v# Example GitHub Actions
- name: Run Tests
run: docker-compose run --rm techword-mcp pytest --cov
- name: Upload Coverage
uses: codecov/codecov-action@v2Coverage is reported as XML (for CI/CD integration):
./run-tests.sh coverage
# Outputs coverage.xml β consume with Codecov, SonarQube, or similarSee tests/README.md for detailed guide on writing tests.