99import pytest
1010
1111from cppython .utility .exception import ProcessError
12- from cppython .utility .subprocess import call
12+ from cppython .utility .subprocess import invoke
1313from cppython .utility .utility import canonicalize_name
1414
1515cppython_logger = logging .getLogger ('cppython' )
@@ -86,8 +86,9 @@ def test_subprocess_stdout(caplog: pytest.LogCaptureFixture) -> None:
8686 python = Path (executable )
8787
8888 with caplog .at_level (logging .INFO ):
89- call (
90- [python , '-c' , "import sys; print('Test Out', file = sys.stdout)" ],
89+ invoke (
90+ python ,
91+ ['-c' , "import sys; print('Test Out', file = sys.stdout)" ],
9192 cppython_logger ,
9293 )
9394
@@ -104,8 +105,9 @@ def test_subprocess_stderr(caplog: pytest.LogCaptureFixture) -> None:
104105 python = Path (executable )
105106
106107 with caplog .at_level (logging .INFO ):
107- call (
108- [python , '-c' , "import sys; print('Test Error', file = sys.stderr)" ],
108+ invoke (
109+ python ,
110+ ['-c' , "import sys; print('Test Error', file = sys.stderr)" ],
109111 cppython_logger ,
110112 )
111113
@@ -122,8 +124,9 @@ def test_subprocess_suppression(caplog: pytest.LogCaptureFixture) -> None:
122124 python = Path (executable )
123125
124126 with caplog .at_level (logging .INFO ):
125- call (
126- [python , '-c' , "import sys; print('Test Out', file = sys.stdout)" ],
127+ invoke (
128+ python ,
129+ ['-c' , "import sys; print('Test Out', file = sys.stdout)" ],
127130 cppython_logger ,
128131 suppress = True ,
129132 )
@@ -139,8 +142,9 @@ def test_subprocess_exit(caplog: pytest.LogCaptureFixture) -> None:
139142 python = Path (executable )
140143
141144 with pytest .raises (ProcessError ) as exec_info , caplog .at_level (logging .INFO ):
142- call (
143- [python , '-c' , "import sys; sys.exit('Test Exit Output')" ],
145+ invoke (
146+ python ,
147+ ['-c' , "import sys; sys.exit('Test Exit Output')" ],
144148 cppython_logger ,
145149 )
146150
@@ -159,8 +163,9 @@ def test_subprocess_exception(caplog: pytest.LogCaptureFixture) -> None:
159163 python = Path (executable )
160164
161165 with pytest .raises (ProcessError ) as exec_info , caplog .at_level (logging .INFO ):
162- call (
163- [python , '-c' , "import sys; raise Exception('Test Exception Output')" ],
166+ invoke (
167+ python ,
168+ ['-c' , "import sys; raise Exception('Test Exception Output')" ],
164169 cppython_logger ,
165170 )
166171
@@ -175,9 +180,9 @@ def test_stderr_exception(caplog: pytest.LogCaptureFixture) -> None:
175180 """
176181 python = Path (executable )
177182 with pytest .raises (ProcessError ) as exec_info , caplog .at_level (logging .INFO ):
178- call (
183+ invoke (
184+ python ,
179185 [
180- python ,
181186 '-c' ,
182187 "import sys; print('Test Out', file = sys.stdout); sys.exit('Test Exit Out')" ,
183188 ],
@@ -200,9 +205,9 @@ def test_stdout_exception(caplog: pytest.LogCaptureFixture) -> None:
200205 """
201206 python = Path (executable )
202207 with pytest .raises (ProcessError ) as exec_info , caplog .at_level (logging .INFO ):
203- call (
208+ invoke (
209+ python ,
204210 [
205- python ,
206211 '-c' ,
207212 "import sys; print('Test Error', file = sys.stderr); sys.exit('Test Exit Error')" ,
208213 ],
0 commit comments