# HG changeset patch # User Denis Laxalde # Date 1477294148 -7200 # Node ID 48d70d143dc1674828bc40d70fa67cee0146d0a8 # Parent def9b3757945a7a73e53a519d689d4a38765545d [test] Use `with open` syntax in cwconfig "prefix" tests diff -r def9b3757945 -r 48d70d143dc1 cubicweb/test/unittest_cwconfig.py --- 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