Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions tests/usethis/_ui/interface/test_interface_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,26 @@ def test_invalid_pyproject_toml(self, tmp_path: Path):

# Assert
assert result.exit_code == 1, result.output

def test_import_pipeline_error_handled(self, tmp_path: Path):
"""Test that import pipeline errors are handled gracefully at CLI level."""
# Arrange - create a bitbucket-pipelines.yml with an import pipeline
(tmp_path / "bitbucket-pipelines.yml").write_text(
"""\
image: atlassian/default-image:3
pipelines:
default:
import: shared-pipeline:master:share-pipeline-1
"""
)
# Add a tool so update_bitbucket_steps gets called
(tmp_path / "pytest.ini").touch()

# Act
runner = CliRunner()
with change_cwd(tmp_path):
result = runner.invoke_safe(app, ["--backend=none"])

# Assert - error should be caught and handled, not propagate as unhandled exception
assert result.exit_code == 1, result.output
assert "import pipeline" in result.output.lower()
Loading