def setUp(self): self.d = "It's not dead, it's sleeping!" with file(TESTFN, 'w') as h: h.write(self.d)