Browse Source

Merge "Fix ResourceWarning: unclosed file"

tags/13.3.0
Zuul 3 months ago
committed by Gerrit Code Review
parent
commit
a54ea2d01a
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      tripleoclient/tests/test_utils.py

+ 4
- 2
tripleoclient/tests/test_utils.py View File

@@ -546,7 +546,8 @@ class TestCreateOvercloudRC(TestCase):
try:
utils.write_overcloudrc(stack_name, overcloudrcs,
config_directory=tempdir)
rc = open(rcfile, 'rt').read()
with open(rcfile, 'rt') as f:
rc = f.read()
self.assertEqual('overcloudrc', rc)
finally:
if os.path.exists(rcfile):
@@ -561,7 +562,8 @@ class TestCreateTempestDeployerInput(TestCase):
with tempfile.NamedTemporaryFile() as cfgfile:
filepath = cfgfile.name
utils.create_tempest_deployer_input(filepath)
cfg = open(filepath, 'rt').read()
with open(filepath, 'rt') as f:
cfg = f.read()
# Just make a simple test, to make sure it created a proper file:
self.assertIn(
'[volume-feature-enabled]\nbootable = true', cfg)


Loading…
Cancel
Save