Implement test_validate_transaction_exception_handling #35

Closed
opened 2026-02-20 06:50:32 +00:00 by cal · 1 comment
Owner

Description

tests/test_services_transaction.py:238-242 — Skipped with reason="Exception handling test needs refactoring for new patterns" and body is just pass. Exception handling in transaction validation is a critical code path with no coverage.

File Locations

  • tests/test_services_transaction.py:238-242

Labels

tech-debt, todo

Priority

medium

## Description `tests/test_services_transaction.py:238-242` — Skipped with `reason="Exception handling test needs refactoring for new patterns"` and body is just `pass`. Exception handling in transaction validation is a critical code path with no coverage. ## File Locations - `tests/test_services_transaction.py:238-242` ## Labels tech-debt, todo ## Priority medium
cal added the
ai-working
label 2026-03-05 08:00:59 +00:00
Author
Owner

Implemented in PR #67: #67

Removed the @pytest.mark.skip and implemented the test by patching RosterValidation in the transaction_service module to raise RuntimeError on its first call. This triggers the except Exception clause at transaction_service.py:187-192, which returns a failed RosterValidation(is_legal=False, errors=["Validation error: ..."]) instead of propagating the exception. All 20 tests in the file now pass.

Implemented in PR #67: https://git.manticorum.com/cal/major-domo-v2/pulls/67 Removed the `@pytest.mark.skip` and implemented the test by patching `RosterValidation` in the `transaction_service` module to raise `RuntimeError` on its first call. This triggers the `except Exception` clause at `transaction_service.py:187-192`, which returns a failed `RosterValidation(is_legal=False, errors=["Validation error: ..."])` instead of propagating the exception. All 20 tests in the file now pass.
cal added
ai-pr-opened
and removed
ai-working
labels 2026-03-05 08:05:14 +00:00
cal closed this issue 2026-03-10 18:26:36 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/major-domo-v2#35
No description provided.