Skip to content

Commit ee5d585

Browse files
committed
Adjust test_toxfile_py_w_ephemeral_envs for Win
1 parent 658da07 commit ee5d585

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/plugin/test_inline.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import sys
34
from typing import TYPE_CHECKING
45

56
if TYPE_CHECKING:
@@ -63,7 +64,12 @@ def tox_add_core_config(core_conf: ConfigSet, state: State) -> None: # noqa: AR
6364

6465
tox_run_result = project.run("run", "-e", "sentinel-env-name", "-q")
6566
tox_run_result.assert_failed()
67+
underlying_expected_oserror_msg = (
68+
"[WinError 2] The system cannot find the file specified"
69+
if sys.platform == "win32"
70+
else "[Errno 2] No such file or directory: 'sentinel-cmd'"
71+
)
6672
expected_cmd_lookup_error_txt = (
67-
"sentinel-env-name: Exception running subprocess [Errno 2] No such file or directory: 'sentinel-cmd'\n"
73+
f"sentinel-env-name: Exception running subprocess {underlying_expected_oserror_msg!s}\n"
6874
)
6975
assert expected_cmd_lookup_error_txt in tox_run_result.out

0 commit comments

Comments
 (0)