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
8 changes: 4 additions & 4 deletions tests/test___init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,23 @@ def test__run_post_hooks_reports_missing_commands(self, project_with_dir: Projec
assert fake_command_name in error.detail

def test__run_post_hooks_reports_stdout_of_commands_that_error_with_no_stderr(self, project_with_dir):
failing_command = "python -c \"print('a message'); exit(1)\""
failing_command = "python3 -c \"print('a message'); exit(1)\""
project_with_dir.config.post_hooks = [failing_command]
project_with_dir._run_post_hooks()

assert len(project_with_dir.errors) == 1
error = project_with_dir.errors[0]
assert error.level == ErrorLevel.ERROR
assert error.header == "python failed"
assert error.header == "python3 failed"
assert "a message" in error.detail

def test__run_post_hooks_reports_stderr_of_commands_that_error(self, project_with_dir):
failing_command = "python -c \"print('a message'); raise Exception('some exception')\""
failing_command = "python3 -c \"print('a message'); raise Exception('some exception')\""
project_with_dir.config.post_hooks = [failing_command]
project_with_dir._run_post_hooks()

assert len(project_with_dir.errors) == 1
error = project_with_dir.errors[0]
assert error.level == ErrorLevel.ERROR
assert error.header == "python failed"
assert error.header == "python3 failed"
assert "some exception" in error.detail