~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_pack.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-18 19:22:46 UTC
  • mfrom: (5861.2.7 bzr-pypy)
  • Revision ID: pqm@pqm.ubuntu.com-20110518192246-x1duixv8rt9v2xml
(mbp) be more careful about closing files in selftest,
 so that more of it passes on pypy (Wouter van Heyst)

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
    def _update_file(self, path, text, checkin=True):
40
40
        """append text to file 'path' and check it in"""
41
 
        open(path, 'a').write(text)
 
41
        with open(path, 'a') as f:
 
42
            f.write(text)
 
43
 
42
44
        if checkin:
43
45
            self.run_bzr(['ci', path, '-m', '"' + path + '"'])
44
46