fastmcp/examples/testing_demo/pyproject.toml
William Easton 8e0c6c8685
docs: clarify pytest-asyncio dependency and asyncio mode configuration (#2399)
* docs: clarify pytest-asyncio dependency and asyncio mode configuration

Added a Prerequisites section to the testing documentation explaining:
- pytest-asyncio is required for async test functions and fixtures
- Recommended configuration: asyncio_mode = 'auto' in pyproject.toml
- This eliminates need for @pytest.mark.asyncio decorators

Resolves #2372

Co-authored-by: William Easton <strawgate@users.noreply.github.com>

* feat: add testing_demo example with comprehensive test suite

Add a standalone example project demonstrating FastMCP testing patterns:
- Tools, resources, and prompts with full test coverage
- pytest-asyncio configuration in pyproject.toml
- 18 passing tests showing async fixtures, parametrized tests, and more
- Documentation explaining testing best practices

Co-authored-by: William Easton <strawgate@users.noreply.github.com>

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: William Easton <strawgate@users.noreply.github.com>
2025-11-15 10:34:29 -05:00

18 lines
413 B
TOML

[project]
name = "testing-demo"
version = "0.1.0"
description = "FastMCP testing example demonstrating pytest-asyncio patterns"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"fastmcp>=2.0.0",
"pytest>=8.3.3",
"pytest-asyncio>=1.2.0",
"dirty-equals>=0.9.0",
]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
pythonpath = ["."]
python_files = ["test_*.py"]