From f153a61277bdcc5222bb56ed5f2e9d3a87521103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20P=C3=B6hn?= Date: Tue, 14 Aug 2018 10:10:19 +0200 Subject: [PATCH] made build.TestCase run independant of cwd --- tests/build.TestCase | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/build.TestCase b/tests/build.TestCase index f563cd6e..9e0edd68 100755 --- a/tests/build.TestCase +++ b/tests/build.TestCase @@ -57,7 +57,7 @@ class BuildTest(unittest.TestCase): def test_force_gradle_build_tools(self): testdir = tempfile.mkdtemp(prefix=inspect.currentframe().f_code.co_name, dir=self.tmpdir) - shutil.copytree(os.path.join(os.path.dirname(__file__), 'source-files'), + shutil.copytree(os.path.join('source-files'), os.path.join(testdir, 'source-files')) teststring = 'FAKE_VERSION_FOR_TESTING' fdroidserver.build.force_gradle_build_tools(testdir, teststring) @@ -73,6 +73,8 @@ class BuildTest(unittest.TestCase): if __name__ == "__main__": + os.chdir(os.path.dirname(__file__)) + parser = optparse.OptionParser() parser.add_option("-v", "--verbose", action="store_true", default=False, help="Spew out even more information than normal")