Skip to content

Commit 9e2afc8

Browse files
committed
docs tests
1 parent 593a82f commit 9e2afc8

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

tests/unit/test_monitoring_unified.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,29 @@ async def test_record_connection_health(self):
242242

243243
@pytest.mark.asyncio
244244
async def test_get_stats_no_data(self):
245-
"""Test get_stats with no data."""
245+
"""
246+
Test get_stats with no data.
247+
248+
What this tests:
249+
---------------
250+
1. Empty stats dictionary structure
251+
2. No errors with zero metrics
252+
3. Consistent stat categories
253+
4. Safe empty state handling
254+
255+
Why this matters:
256+
----------------
257+
- Graceful startup behavior
258+
- No NPEs in monitoring code
259+
- Consistent API responses
260+
- Clean initial state
261+
262+
Additional context:
263+
---------------------------------
264+
- Returns valid structure even if empty
265+
- All stat categories present
266+
- Zero values, not null/missing
267+
"""
246268
collector = InMemoryMetricsCollector()
247269
stats = await collector.get_stats()
248270

0 commit comments

Comments
 (0)