Skip to content

Commit 263ce0a

Browse files
committed
Remove the use of sh in tests
1 parent 09d7cee commit 263ce0a

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Run Tests
22

33
on:
44
push:
5-
branches:
6-
- main
75
pull_request:
86

97
concurrency:

tests/test_zip_imports.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
import os
2+
import subprocess
23
import sys
34
import textwrap
45
from typing import List
56
from unittest import mock
67
from zipfile import ZipFile
78

8-
import pytest
9-
10-
if sys.platform != "win32":
11-
import sh
12-
139

1410
def walk_to_root(path: str):
1511
last_dir = None
@@ -65,7 +61,6 @@ def test_load_dotenv_gracefully_handles_zip_imports_when_no_env_file(tmp_path):
6561
import child1.child2.test # noqa
6662

6763

68-
@pytest.mark.skipif(sys.platform == "win32", reason="sh module doesn't support Windows")
6964
def test_load_dotenv_outside_zip_file_when_called_in_zipfile(tmp_path):
7065
zip_file_path = setup_zipfile(
7166
tmp_path,
@@ -99,8 +94,12 @@ def test_load_dotenv_outside_zip_file_when_called_in_zipfile(tmp_path):
9994
"""
10095
)
10196
)
102-
os.chdir(str(tmp_path))
10397

104-
result = sh.Command(sys.executable)(code_path)
98+
result = subprocess.run(
99+
[sys.executable, str(code_path)],
100+
capture_output=True,
101+
text=True,
102+
cwd=tmp_path,
103+
)
105104

106-
assert result == "b\n"
105+
assert result.stdout == "b\n"

0 commit comments

Comments
 (0)