'Patch L{_options.open} so we can capture usage and prevent actual opens.'

def patchOpen(self):

    self.opened = []
    def fakeOpen(name, mode=None):
        if (name == 'nocanopen'):
            raise IOError(None, None, name)
        self.opened.append((name, mode))
        return NotImplemented
    self.patch(_options, 'openFile', fakeOpen)
