Files
freemo c0c494eec1 bug(testing): TDD infrastructure fails to invert non-AssertionError exceptions in expected-fail tests
Removed the non-AssertionError exception guard from apply_tdd_inversion in features/environment.py. The previous guard prevented inversion when a step failed with any exception other than AssertionError. With this change, any exception type (e.g., RuntimeError, TypeError, JSONDecodeError) will be inverted for @tdd_expected_fail tests.

Clarity and consistency were improved by updating:
- Docstrings: Updated in apply_tdd_inversion and handle_tdd_expected_fail to remove references to the removed guard.
- Tests and scenarios:
  - features/tdd_expected_fail_infrastructure.feature: updated to verify non-AssertionError exceptions are inverted.
  - features/testing/tdd_tag_validation.feature: updated to verify non-AssertionError exceptions are inverted.
- Step definitions:
  - features/steps/tdd_tag_validation_steps.py
  - features/steps/tdd_expected_fail_infrastructure_steps.py
  to align with the corrected inversion behavior.

Key design decisions:
- The guard was incorrect because TDD bug-capture tests are specifically designed to reproduce non-assertion exceptions (e.g., JSONDecodeError, TypeError, KeyError). Inversion should apply broadly to any exception type for these tests.
- The hook_failed and dry-run guards remain in place to protect against genuine infrastructure failures.
- All existing test scenarios were updated to reflect the corrected behavior, ensuring consistent expectations across the suite.

ISSUES CLOSED: #3472
2026-04-05 19:19:19 +00:00
..
2026-02-23 03:11:12 +00:00