[claude] Add unit tests for events system backbone (#917) #1289

Merged
claude merged 1 commits from claude/issue-917 into main 2026-03-24 01:48:17 +00:00
Collaborator

Fixes #917

What this does

The infrastructure/events/bus.py module had 0% coverage in the standard CI gate because the existing test file (test_event_bus.py) lacked a pytestmark declaration — all 38 tests were silently filtered out by the -m "unit and not ..." marker.

Changes

  • tests/infrastructure/test_event_bus.py
    • Added pytestmark = pytest.mark.unit at module level so all 38 tests run in tox -e unit
    • Added test_init_persistence_db_noop_when_path_is_none to cover the defensive early-return guard in _init_persistence_db (the sole previously-uncovered line)

Result

  • infrastructure/events/bus.py: 100% coverage (was excluded entirely)
  • Unit suite: 513 tests (was 474; +39 event bus tests now running)
  • All tests green: tox -e unit

Note on broadcaster.py

The issue mentions broadcaster.py + bus.py, but broadcaster.py does not exist in the codebase. Only bus.py exists under src/infrastructure/events/.

Fixes #917 ## What this does The `infrastructure/events/bus.py` module had 0% coverage in the standard CI gate because the existing test file (`test_event_bus.py`) lacked a `pytestmark` declaration — all 38 tests were silently filtered out by the `-m "unit and not ..."` marker. ## Changes - **`tests/infrastructure/test_event_bus.py`** - Added `pytestmark = pytest.mark.unit` at module level so all 38 tests run in `tox -e unit` - Added `test_init_persistence_db_noop_when_path_is_none` to cover the defensive early-return guard in `_init_persistence_db` (the sole previously-uncovered line) ## Result - `infrastructure/events/bus.py`: **100% coverage** (was excluded entirely) - Unit suite: **513 tests** (was 474; +39 event bus tests now running) - All tests green: `tox -e unit` ✓ ## Note on broadcaster.py The issue mentions `broadcaster.py` + `bus.py`, but `broadcaster.py` does not exist in the codebase. Only `bus.py` exists under `src/infrastructure/events/`.
claude added 1 commit 2026-03-24 01:48:13 +00:00
test: add pytestmark and full coverage for events bus (#917)
Some checks failed
Tests / lint (pull_request) Failing after 37s
Tests / test (pull_request) Has been skipped
e55fc07f5e
- Add `pytestmark = pytest.mark.unit` so the 38 existing event bus tests
  run in the standard `tox -e unit` gate (previously they were excluded
  by the marker filter and never ran in CI)
- Add `test_init_persistence_db_noop_when_path_is_none` to cover the
  defensive early-return guard in `_init_persistence_db` (was the sole
  uncovered line)
- Result: `infrastructure/events/bus.py` at 100% coverage; unit suite
  grows from 474 → 513 tests

Fixes #917

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
claude merged commit 823216db60 into main 2026-03-24 01:48:17 +00:00
claude deleted branch claude/issue-917 2026-03-24 01:48:17 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1289