Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e6edc03

Browse files
committed
#22512: move distutils rpm test's .rpmdb to testing tmpdir.
Patch by Francis MB.
1 parent b6271f2 commit e6edc03

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/distutils/tests/test_bdist_rpm.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"""
2525

2626
class BuildRpmTestCase(support.TempdirManager,
27+
support.EnvironGuard,
2728
support.LoggingSilencer,
2829
unittest.TestCase):
2930

@@ -54,6 +55,7 @@ def tearDown(self):
5455
def test_quiet(self):
5556
# let's create a package
5657
tmp_dir = self.mkdtemp()
58+
os.environ['HOME'] = tmp_dir # to confine dir '.rpmdb' creation
5759
pkg_dir = os.path.join(tmp_dir, 'foo')
5860
os.mkdir(pkg_dir)
5961
self.write_file((pkg_dir, 'setup.py'), SETUP_PY)
@@ -96,6 +98,7 @@ def test_quiet(self):
9698
def test_no_optimize_flag(self):
9799
# let's create a package that brakes bdist_rpm
98100
tmp_dir = self.mkdtemp()
101+
os.environ['HOME'] = tmp_dir # to confine dir '.rpmdb' creation
99102
pkg_dir = os.path.join(tmp_dir, 'foo')
100103
os.mkdir(pkg_dir)
101104
self.write_file((pkg_dir, 'setup.py'), SETUP_PY)

0 commit comments

Comments
 (0)