From f90de9b625de1f6b9af39489ea31f0484bcea4cb Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Feb 09 2018 13:17:29 +0000 Subject: Fix hardcoded directory name in test Relates: https://pagure.io/rpkg/issue/288 Signed-off-by: Lubomír Sedlář --- diff --git a/tests/test_commands.py b/tests/test_commands.py index cb6c757..db9f435 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -76,6 +76,11 @@ class LoadNameVerRelTest(CommandTestCase): super(LoadNameVerRelTest, self).setUp() self.cmd = self.make_commands() self.checkout_branch(self.cmd.repo, 'eng-rhel-6') + self.tempdir = tempfile.mkdtemp(prefix='rpkg_test_') + + def tearDown(self): + super(LoadNameVerRelTest, self).tearDown() + shutil.rmtree(self.tempdir) def test_load_from_spec(self): """Ensure name, version, release can be loaded from a valid SPEC""" @@ -94,7 +99,7 @@ class LoadNameVerRelTest(CommandTestCase): For this test purpose, firstly, original repo has to be cloned to a new place which has a name containing arbitrary spaces. """ - cloned_repo_dir = '/tmp/rpkg test cloned repo' + cloned_repo_dir = os.path.join(self.tempdir, 'rpkg test cloned repo') if os.path.exists(cloned_repo_dir): shutil.rmtree(cloned_repo_dir) cloned_repo = self.cmd.repo.clone(cloned_repo_dir)