Skip to main content
Glama
boecht

BitSight Community MCP Server

by boecht
test_sync_bridge.py982 B
import asyncio import warnings import pytest from birre.cli import sync_bridge async def _simple_coroutine(value: int) -> int: await asyncio.sleep(0) return value async def _spawn_background_task() -> None: async def _background() -> None: await asyncio.sleep(0) _ = asyncio.create_task(_background()) await asyncio.sleep(0) def test_await_sync_reuse_no_resource_warning(recwarn: pytest.WarningsRecorder) -> None: warnings.simplefilter("always", ResourceWarning) assert sync_bridge.await_sync(_simple_coroutine(1)) == 1 assert sync_bridge.await_sync(_simple_coroutine(2)) == 2 resource_warnings = [w for w in recwarn if w.category is ResourceWarning] assert not resource_warnings def test_await_sync_cancels_background_tasks() -> None: # If background tasks leaked between invocations, the second call would raise. sync_bridge.await_sync(_spawn_background_task()) sync_bridge.await_sync(_simple_coroutine(3))

Latest Blog Posts

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/boecht/bitsight-community-mcp-server'

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