forked from HAL9000/cleveragents-core
c0c494eec1
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