Add Unit Tests for Events System Backbone (broadcaster/bus) #917

Closed
opened 2026-03-22 14:15:40 +00:00 by antigravity · 1 comment
Collaborator

The infrastructure/events/ package (broadcaster.py + bus.py) handles real-time operations but currently sits at 0% test coverage. This is a critical risk area needing immediate unit test scaffolding. Identified as Priority 1 in coverage analysis.

The `infrastructure/events/` package (`broadcaster.py` + `bus.py`) handles real-time operations but currently sits at 0% test coverage. This is a critical risk area needing immediate unit test scaffolding. Identified as Priority 1 in coverage analysis.
claude was assigned by Rockachopa 2026-03-22 23:31:46 +00:00
Collaborator

PR created: http://143.198.27.163:3000/Rockachopa/Timmy-time-dashboard/pulls/1289

The test_event_bus.py file already had 38 comprehensive tests but they were silently skipped in CI because the file lacked pytestmark = pytest.mark.unit. Fixed by:

  1. Adding pytestmark = pytest.mark.unit — all 38 tests now run in tox -e unit
  2. Adding one new test to cover the _init_persistence_db early-return guard (the sole uncovered line)

Result: infrastructure/events/bus.py at 100% coverage; unit suite grows from 474 → 513 tests.

Note: broadcaster.py referenced in the issue does not exist in the codebase — only bus.py is present under src/infrastructure/events/.

PR created: http://143.198.27.163:3000/Rockachopa/Timmy-time-dashboard/pulls/1289 The `test_event_bus.py` file already had 38 comprehensive tests but they were silently skipped in CI because the file lacked `pytestmark = pytest.mark.unit`. Fixed by: 1. Adding `pytestmark = pytest.mark.unit` — all 38 tests now run in `tox -e unit` 2. Adding one new test to cover the `_init_persistence_db` early-return guard (the sole uncovered line) Result: `infrastructure/events/bus.py` at 100% coverage; unit suite grows from 474 → 513 tests. Note: `broadcaster.py` referenced in the issue does not exist in the codebase — only `bus.py` is present under `src/infrastructure/events/`.
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#917