~gz/brz/knit_load_py3

« back to all changes in this revision

Viewing changes to breezy/tests/test_mergetools.py

  • Committer: Jelmer Vernooij
  • Date: 2018-06-17 11:15:04 UTC
  • mto: (6973.12.2 python3-k)
  • mto: This revision was merged to the branch mainline in revision 7003.
  • Revision ID: jelmer@jelmer.uk-20180617111504-i2eqvqbtfj5bp0t3
s/file/open.

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
            self._exe = exe
147
147
            self._args = args
148
148
            self.assertPathExists(args[0])
149
 
            f = open(args[0], 'wt')
150
 
            f.write('temp stuff')
151
 
            f.close()
 
149
            with open(args[0], 'wt') as f:
 
150
                f.write('temp stuff')
152
151
            cleanup(0)
153
152
            return 0
154
153
        retcode = mergetools.invoke('tool {this_temp}', 'test.txt',
164
163
            self._args = args
165
164
            self.assertPathExists(args[0])
166
165
            self.log(repr(args))
167
 
            f = open(args[0], 'wt')
168
 
            self.log(repr(f))
169
 
            f.write('temp stuff')
170
 
            f.close()
 
166
            with open(args[0], 'wt') as f:
 
167
                self.log(repr(f))
 
168
                f.write('temp stuff')
171
169
            cleanup(1)
172
170
            return 1
173
171
        retcode = mergetools.invoke('tool {this_temp}', 'test.txt',