From f74cfbfc7912668347fe44b29f95e771d08db1b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20KUBLER?= <gregoire.kubler@proton.me>
Date: Mon, 15 Jul 2024 15:34:00 +0200
Subject: [PATCH] fix : missing cwd argument to run_command call

---
 aidge_core/unit_tests/test_export.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/aidge_core/unit_tests/test_export.py b/aidge_core/unit_tests/test_export.py
index 74fbba50e..e7ba8a396 100644
--- a/aidge_core/unit_tests/test_export.py
+++ b/aidge_core/unit_tests/test_export.py
@@ -50,16 +50,17 @@ def enqueue_output(stream, queue):
     stream.close()
 
 
-def run_command(command : list[str], cwd : pathlib.Path):
+def run_command(command : list[str], cwd : pathlib.Path = None):
     """
     This function has the job to run a command and return stdout and stderr that are not shown
-    by subprocess :
-
+    by subprocess.check_call / call.
+    If the subprocess returns smthg else than 0, it will raise an error. 
     Arg:
         command : written with the same syntax as subprocess.call
+        cwd : path from where the command must be called
     """
     process = subprocess.Popen(
-        command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
+        command, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
     )
 
     stdout_queue = queue.Queue()
-- 
GitLab