1
0
mirror of https://github.com/openSUSE/osc.git synced 2026-07-13 08:35:23 +02:00

Fix resource warnings (unclosed files)

This commit is contained in:
2022-08-24 08:43:09 +02:00
parent 1c581fdf2c
commit 9cc4a5594f
11 changed files with 81 additions and 44 deletions
+2 -1
View File
@@ -84,7 +84,8 @@ class TestInitPackage(OscTestCase):
"""initialize a package dir (dir is a file)"""
pac_dir = os.path.join(self.tmpdir, 'testpkg')
os.mkdir(pac_dir)
open(os.path.join(pac_dir, osc.core.store), 'w').write('foo\n')
with open(os.path.join(pac_dir, osc.core.store), 'w') as f:
f.write('foo\n')
self.assertRaises(osc.oscerr.OscIOError, osc.core.Package.init_package, 'http://localhost', 'osctest', 'testpkg', pac_dir)
if __name__ == '__main__':