'Test that file created is closed during the run.'

def test_logFileGetsClosed(self):

    oldSetUpLogFile = self.runner._setUpLogFile
    l = []
    def setUpLogFile():
        oldSetUpLogFile()
        l.append(self.runner._logFileObject)
    self.runner._setUpLogFile = setUpLogFile
    self.runner.run(self.test)
    self.assertEqual(len(l), 1)
    self.assertTrue(l[0].closed)
