~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_inv.py

  • Committer: Wouter van Heyst
  • Date: 2012-01-25 21:13:15 UTC
  • mto: (6437.3.27 2.5)
  • mto: This revision was merged to the branch mainline in revision 6451.
  • Revision ID: larstiq@larstiq.dyndns.org-20120125211315-ch74doua37bqet0i
mechanically replace file().write() pattern with a with-keyword version

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
        wt.lock_tree_write()
31
31
        self.addCleanup(wt.unlock)
32
32
        self.assertEqual(len(wt.all_file_ids()), 1)
33
 
        open('b1/a', 'wb').write('a test\n')
 
33
        with open('b1/a', 'wb') as f: f.write('a test\n')
34
34
        wt.add('a')
35
35
        self.assertEqual(len(wt.all_file_ids()), 2)
36
36
        wt.flush() # workaround revert doing wt._write_inventory for now.