]> granicus.if.org Git - python/commitdiff
#22512: move distutils rpm test's .rpmdb to testing tmpdir.
authorR David Murray <rdmurray@bitdance.com>
Wed, 1 Oct 2014 00:53:21 +0000 (20:53 -0400)
committerR David Murray <rdmurray@bitdance.com>
Wed, 1 Oct 2014 00:53:21 +0000 (20:53 -0400)
Patch by Francis MB.

Lib/distutils/tests/test_bdist_rpm.py

index bcbb5633e82311cf246328967f4dc2365f87381a..25c14abd322ca2c5f74326e9287473bbd4ad5b62 100644 (file)
@@ -24,6 +24,7 @@ setup(name='foo', version='0.1', py_modules=['foo'],
 """
 
 class BuildRpmTestCase(support.TempdirManager,
+                       support.EnvironGuard,
                        support.LoggingSilencer,
                        unittest.TestCase):
 
@@ -54,6 +55,7 @@ class BuildRpmTestCase(support.TempdirManager,
     def test_quiet(self):
         # let's create a package
         tmp_dir = self.mkdtemp()
+        os.environ['HOME'] = tmp_dir   # to confine dir '.rpmdb' creation
         pkg_dir = os.path.join(tmp_dir, 'foo')
         os.mkdir(pkg_dir)
         self.write_file((pkg_dir, 'setup.py'), SETUP_PY)
@@ -96,6 +98,7 @@ class BuildRpmTestCase(support.TempdirManager,
     def test_no_optimize_flag(self):
         # let's create a package that brakes bdist_rpm
         tmp_dir = self.mkdtemp()
+        os.environ['HOME'] = tmp_dir   # to confine dir '.rpmdb' creation
         pkg_dir = os.path.join(tmp_dir, 'foo')
         os.mkdir(pkg_dir)
         self.write_file((pkg_dir, 'setup.py'), SETUP_PY)