'Tests invoking FileInput.nextfile() when the attempt to delete
the backup file would raise OSError.  This error is expected to be
silently ignored'

def test_nextfile_oserror_deleting_backup(self):

    os_unlink_orig = os.unlink
    os_unlink_replacement = UnconditionallyRaise(OSError)
    try:
        t = writeTmp(1, ['\n'])
        self.addCleanup(remove_tempfiles, t)
        with FileInput(files=[t], inplace=True) as fi:
            next(fi)
            os.unlink = os_unlink_replacement
            fi.nextfile()
    finally:
        os.unlink = os_unlink_orig
    self.assertTrue(os_unlink_replacement.invoked, 'os.unlink()    was    not    invoked')
