[elbe-devel] [PATCH v2 24/27] tests test_xml: do not os.chdir() in TestPBuilder

Torben Hohn torben.hohn at linutronix.de
Thu Sep 24 16:56:21 CEST 2020


later tests are broken by this action.
The build_dir is removed, and os.getcwd() will fail after this.

Just prepend the command with "cd <builddir>; "

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/tests/test_xml.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/elbepack/tests/test_xml.py b/elbepack/tests/test_xml.py
index 03ff9c353..fc3e18acb 100644
--- a/elbepack/tests/test_xml.py
+++ b/elbepack/tests/test_xml.py
@@ -75,8 +75,9 @@ class TestPbuilder(ElbeTestCase):
 
                 with open(prj, "r") as f:
                     uuid = f.read()
-                    os.chdir(build_dir)
-                    system('%s pbuilder build --project %s' % (elbe_exe, uuid))
+                    system('cd "%s"; %s pbuilder build --project %s' % (build_dir,
+                                                                        elbe_exe,
+                                                                        uuid))
             # pylint: disable=try-except-raise
             except:
                 raise
-- 
2.20.1



More information about the elbe-devel mailing list