Skip to main content
Glama
pytest_asyncio_plugin.py1.05 kB
"""Very small asyncio plugin for pytest. The real project depends on ``pytest-asyncio`` to run ``async def`` test functions. To keep the exercise self contained we provide a minimal implementation that recognises ``@pytest.mark.asyncio`` and executes the test coroutine using :func:`asyncio.run`. """ from __future__ import annotations import asyncio import inspect from typing import Any def pytest_configure(config) -> None: # pragma: no cover - plugin hook config.addinivalue_line("markers", "asyncio: mark test as an async coroutine") def pytest_pyfunc_call(pyfuncitem): # pragma: no cover - plugin hook if inspect.iscoroutinefunction(pyfuncitem.function): # Only pass fixtures that the test function actually expects to avoid # unexpected keyword arguments from autouse fixtures. kwargs = { name: pyfuncitem.funcargs[name] for name in pyfuncitem._fixtureinfo.argnames } coro = pyfuncitem.obj(**kwargs) asyncio.run(coro) return True return None

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Vijay-Duke/mcp-gitlab'

If you have feedback or need assistance with the MCP directory API, please join our Discord server