~ubuntu-branches/ubuntu/natty/python3.1/natty-security

« back to all changes in this revision

Viewing changes to Lib/test/list_tests.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-07-06 16:52:42 UTC
  • mfrom: (1.2.1 upstream) (2.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20100706165242-2xv4i019r3et6c0j
Tags: 3.1.2+20100706-1ubuntu1
* Merge with Debian; remaining changes:
  - Regenerate the control file.
  - Add debian/patches/overwrite-semaphore-check for Lucid buildds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        d.append(d)
67
67
        d.append(400)
68
68
        try:
69
 
            fo = open(support.TESTFN, "w")
70
 
            fo.write(str(d))
71
 
            fo.close()
72
 
            fo = open(support.TESTFN, "r")
73
 
            self.assertEqual(fo.read(), repr(d))
 
69
            with open(support.TESTFN, "w") as fo:
 
70
                fo.write(str(d))
 
71
            with open(support.TESTFN, "r") as fo:
 
72
                self.assertEqual(fo.read(), repr(d))
74
73
        finally:
75
 
            fo.close()
76
74
            os.remove(support.TESTFN)
77
75
 
78
76
    def test_set_subscript(self):