tests/test-atomictempfile.py
changeset 32279 68c43a416585
parent 30332 318a24b52eeb
child 36285 3ec9afb951a0
equal deleted inserted replaced
32278:7c3ef55dedbe 32279:68c43a416585
    45         self.assertTrue(basename not in os.listdir('.'))
    45         self.assertTrue(basename not in os.listdir('.'))
    46 
    46 
    47     # if a programmer screws up and passes bad args to atomictempfile, they
    47     # if a programmer screws up and passes bad args to atomictempfile, they
    48     # get a plain ordinary TypeError, not infinite recursion
    48     # get a plain ordinary TypeError, not infinite recursion
    49     def testoops(self):
    49     def testoops(self):
    50         self.assertRaises(TypeError, atomictempfile)
    50         with self.assertRaises(TypeError):
       
    51             atomictempfile()
    51 
    52 
    52     # checkambig=True avoids ambiguity of timestamp
    53     # checkambig=True avoids ambiguity of timestamp
    53     def testcheckambig(self):
    54     def testcheckambig(self):
    54         def atomicwrite(checkambig):
    55         def atomicwrite(checkambig):
    55             f = atomictempfile(self._filename, checkambig=checkambig)
    56             f = atomictempfile(self._filename, checkambig=checkambig)