Files
temp/features/tdd_indentation_library_try_except.feature
freemo 8ea00f5185 fix: restore CI quality tests to passing state (#4175)
Co-authored-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
Co-committed-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
2026-04-08 11:02:14 +00:00

56 lines
2.6 KiB
Gherkin

# @tdd_issue @tdd_issue_2845 @tdd_expected_fail @tdd_issue_4178 @skip
@skip
Feature: TDD Issue #2845 — fix_python_indentation handles try...except...finally correctly
As a Robot Framework user
I want fix_python_indentation to correctly reconstruct indentation for try...except...finally blocks
So that inline Python scripts with exception handling produce syntactically valid code
Background:
Given the fix_python_indentation function is available
# @tdd_issue @tdd_issue_4282 @tdd_expected_fail @skip
@skip
Scenario: Single except clause produces valid Python
When I fix indentation for a try block with a single except clause
Then the indentation result should be syntactically valid Python
And the try body should be indented one level
And the except clause should be at the same level as try
And the except body should be indented one level
# @tdd_issue @tdd_issue_4282 @tdd_expected_fail @skip
@skip
Scenario: Multiple except clauses produce valid Python
When I fix indentation for a try block with multiple except clauses
Then the indentation result should be syntactically valid Python
And all except clauses should be at the same level as try
And each except body should be indented one level
# @tdd_issue @tdd_issue_4282 @tdd_expected_fail @skip
@skip
Scenario: try...except...finally produces valid Python
When I fix indentation for a try block with except and finally
Then the indentation result should be syntactically valid Python
And the finally clause should be at the same level as try
And the finally body should be indented one level
# @tdd_issue @tdd_issue_4282 @tdd_expected_fail @skip
@skip
Scenario: Nested try blocks produce valid Python
When I fix indentation for nested try blocks
Then the indentation result should be syntactically valid Python
And the inner try should be indented one level inside the outer try
And the outer except should be at the same level as the outer try
# @tdd_issue @tdd_issue_4282 @tdd_expected_fail @skip
@skip
Scenario: Nested try with finally then outer except produces valid Python
When I fix indentation for nested try with inner finally and outer except
Then the indentation result should be syntactically valid Python
And the outer except should be at the same level as the outer try
# @tdd_issue @tdd_issue_4282 @tdd_expected_fail @skip
@skip
Scenario: Code after try block produces valid Python
When I fix indentation for code that follows a try block
Then the indentation result should be syntactically valid Python