Skip to content

Commit dc84dd8

Browse files
committed
fix windows CI issue
1 parent 33db96e commit dc84dd8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tests/conftest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import os
23
import subprocess
34
from pathlib import Path
45

@@ -10,14 +11,18 @@
1011
def conda_env(tmp_path):
1112
env_dir = tmp_path / "fake_env"
1213
env_dir_str = env_dir.as_posix()
14+
shell = os.name == "nt"
1315
subprocess.run(
1416
["conda", "create", "-y", "-p", env_dir_str],
1517
check=True,
1618
capture_output=True,
19+
shell=shell,
1720
)
1821
yield env_dir_str
1922
subprocess.run(
20-
["conda", "env", "remove", "-p", env_dir_str, "-y"], check=True
23+
["conda", "env", "remove", "-p", env_dir_str, "-y"],
24+
check=True,
25+
shell=shell,
2126
)
2227

2328

tests/test_packsmanager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
import re
33
import subprocess
4-
import sys
54
from pathlib import Path
65

76
import pytest
@@ -376,7 +375,7 @@ def test_print_packs_and_examples(
376375
packs_to_install, expected, example_cases, capsys, conda_env
377376
):
378377
env_dir_str = Path(conda_env).as_posix()
379-
shell = sys.platform.startswith("win")
378+
shell = os.name == "nt"
380379
req_dir = example_cases / "case5" / "requirements" / "packs"
381380
for pack in packs_to_install:
382381
req_file = (req_dir / f"{pack}.txt").as_posix()

0 commit comments

Comments
 (0)