Skip to content

Commit f21b779

Browse files
Copilotneelay-aign
andcommitted
fix(tests): improve subprocess error reporting in MCP tests
Replace subprocess.check_call() with subprocess.run() for pip operations. This ensures stderr is captured and included in CalledProcessError exceptions, making CI failures easier to debug. - Use capture_output=True and text=True for better error visibility - Applies to both pip install and pip uninstall operations Co-authored-by: neelay-aign <190385684+neelay-aign@users.noreply.github.com>
1 parent 1760623 commit f21b779

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/aignostics/utils/mcp_test.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,11 @@ def install_dummy_mcp_plugin() -> Iterator[None]:
209209
import importlib
210210
import site
211211

212-
subprocess.check_call(
212+
result = subprocess.run(
213213
[sys.executable, "-m", "pip", "install", "-e", str(DUMMY_PLUGIN_DIR)],
214-
stdout=subprocess.DEVNULL,
215-
stderr=subprocess.PIPE,
214+
check=True,
215+
capture_output=True,
216+
text=True,
216217
)
217218

218219
importlib.invalidate_caches()
@@ -221,10 +222,11 @@ def install_dummy_mcp_plugin() -> Iterator[None]:
221222

222223
yield
223224

224-
subprocess.check_call(
225+
result = subprocess.run(
225226
[sys.executable, "-m", "pip", "uninstall", "-y", "mcp-dummy-plugin"],
226-
stdout=subprocess.DEVNULL,
227-
stderr=subprocess.PIPE,
227+
check=True,
228+
capture_output=True,
229+
text=True,
228230
)
229231

230232

0 commit comments

Comments
 (0)