diff --git a/tests/console/commands/test_run.py b/tests/console/commands/test_run.py index 8e3d9b951eb..60bc94e74a7 100644 --- a/tests/console/commands/test_run.py +++ b/tests/console/commands/test_run.py @@ -1,5 +1,7 @@ from __future__ import annotations +import subprocess + from typing import TYPE_CHECKING import pytest @@ -127,7 +129,12 @@ def test_run_script_exit_code( poetry_with_scripts: Poetry, command_tester_factory: CommandTesterFactory, tmp_venv: VirtualEnv, + mocker: MockerFixture, ) -> None: + mocker.patch( + "os.execvpe", + lambda file, args, env: subprocess.call([file] + args[1:], env=env), + ) install_tester = command_tester_factory( "install", poetry=poetry_with_scripts,