mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
fix(telemetry): Apply enterprise formatting fixes
- Remove extra blank line in lifecycle.py import section - Remove unused MagicMock import in test_lifecycle.py - Reformat multi-line AsyncMock side_effect argument Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
parent
92a86624b0
commit
0b7610054b
@ -4,7 +4,6 @@ from contextlib import asynccontextmanager
|
||||
from typing import AsyncIterator
|
||||
|
||||
from fastapi import FastAPI
|
||||
|
||||
from server.logger import logger
|
||||
from server.telemetry.service import telemetry_service
|
||||
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
"""Unit tests for the telemetry lifespan integration."""
|
||||
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
from fastapi import FastAPI
|
||||
|
||||
from server.telemetry.lifecycle import telemetry_lifespan
|
||||
|
||||
|
||||
@ -59,7 +58,9 @@ class TestTelemetryLifespan:
|
||||
'server.telemetry.lifecycle.telemetry_service'
|
||||
) as mock_telemetry_service:
|
||||
mock_telemetry_service.start = AsyncMock()
|
||||
mock_telemetry_service.stop = AsyncMock(side_effect=Exception('Stop failed'))
|
||||
mock_telemetry_service.stop = AsyncMock(
|
||||
side_effect=Exception('Stop failed')
|
||||
)
|
||||
|
||||
# Should not raise exception
|
||||
async with telemetry_lifespan(mock_app):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user