Skip to content

Commit f08682e

Browse files
test: Rename python to python3 in tests (#1223)
This commit renames the invocation of `python` to `python3` in the tests. While many systems now alias `python` to `python3`, this behavior is not guaranteed across all environments and is often configured by the user, rather than provided by the operating system directly. Explicitly using `python3` ensures that the tests are executed with the intended Python 3 interpreter, regardless of user-specific configurations, and therefore improves the portability and reliability of the test suite.
1 parent 25fe48e commit f08682e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test___init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,23 @@ def test__run_post_hooks_reports_missing_commands(self, project_with_dir: Projec
4242
assert fake_command_name in error.detail
4343

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

4949
assert len(project_with_dir.errors) == 1
5050
error = project_with_dir.errors[0]
5151
assert error.level == ErrorLevel.ERROR
52-
assert error.header == "python failed"
52+
assert error.header == "python3 failed"
5353
assert "a message" in error.detail
5454

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

6060
assert len(project_with_dir.errors) == 1
6161
error = project_with_dir.errors[0]
6262
assert error.level == ErrorLevel.ERROR
63-
assert error.header == "python failed"
63+
assert error.header == "python3 failed"
6464
assert "some exception" in error.detail

0 commit comments

Comments
 (0)