cubicweb/test/unittest_cwconfig.py
changeset 11743 48d70d143dc1
parent 11710 dd5df5fe7137
child 11744 a6dc650bc230
--- a/cubicweb/test/unittest_cwconfig.py	Mon Oct 24 09:02:53 2016 +0200
+++ b/cubicweb/test/unittest_cwconfig.py	Mon Oct 24 09:29:08 2016 +0200
@@ -229,9 +229,8 @@
     def make_file(self, *args):
         self.make_dirs(*args[: -1])
         file_path = join(tempfile.tempdir, *args)
-        file_obj = open(file_path, 'w')
-        file_obj.write('""" None """')
-        file_obj.close()
+        with open(file_path, 'w') as f:
+            f.write('""" None """')
         return file_path
 
     @with_tempdir