'Tests invoking FileInput.readline() when os.fstat() raises OSError.
This exception should be silently discarded.'

def test_readline_os_fstat_raises_OSError(self):

    os_fstat_orig = os.fstat
    os_fstat_replacement = UnconditionallyRaise(OSError)
    try:
        t = writeTmp(1, ['\n'])
        self.addCleanup(remove_tempfiles, t)
        with FileInput(files=[t], inplace=True) as fi:
            os.fstat = os_fstat_replacement
            fi.readline()
    finally:
        os.fstat = os_fstat_orig
    self.assertTrue(os_fstat_replacement.invoked, 'os.fstat()    was    not    invoked')
