Skip to content

Commit

Permalink
Remove unnecessary try-finally block in test_cli.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielluiz committed Oct 25, 2024
1 parent c1236bf commit 50938a7
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/backend/tests/unit/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@ def test_components_path(runner, default_settings, tmp_path):
temp_dir = tmp_path / "components"
temp_dir.mkdir(exist_ok=True)

try:
result = runner.invoke(
app,
["run", "--components-path", str(temp_dir), *default_settings],
)
assert result.exit_code == 0, result.stdout
settings_service = deps.get_settings_service()
assert str(temp_dir) in settings_service.settings.components_path
finally:
# Ensure any open resources are properly closed
deps.close_resources()
result = runner.invoke(
app,
["run", "--components-path", str(temp_dir), *default_settings],
)
assert result.exit_code == 0, result.stdout
settings_service = deps.get_settings_service()
assert str(temp_dir) in settings_service.settings.components_path


@pytest.mark.usefixtures("client")
Expand Down

0 comments on commit 50938a7

Please sign in to comment.