From 79bfe5a04dfc2d77b91d8b10c80dd143daba7d73 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Mon, 15 Jun 2020 19:10:13 +0200 Subject: [PATCH] tests: Return to kas directory when test_patch finishes This prevents subseqent tests from starting in the wrong directory. Signed-off-by: Paul Barker Signed-off-by: Jan Kiszka --- tests/test_patch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_patch.py b/tests/test_patch.py index a28a17a..e463c42 100644 --- a/tests/test_patch.py +++ b/tests/test_patch.py @@ -32,8 +32,10 @@ def test_patch(tmpdir): tdir = str(tmpdir.mkdir('test_patch')) shutil.rmtree(tdir, ignore_errors=True) shutil.copytree('tests/test_patch', tdir) + prev_dir = os.path.realpath(os.getcwd()) os.chdir(tdir) kas.kas(['shell', 'test.yml', '-c', 'true']) for f in ['kas/tests/test_patch/hello.sh', 'hello/hello.sh']: assert os.stat(f)[stat.ST_MODE] & stat.S_IXUSR kas.kas(['shell', 'test.yml', '-c', 'true']) + os.chdir(prev_dir)