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

Bastian Germann bage at linutronix.de
Thu Sep 24 18:50:52 CEST 2020


Am 24.09.20 um 16:56 schrieb Torben Hohn:
> 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>

Reviewed-by: Bastian Germann <bage 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
> 


More information about the elbe-devel mailing list