def test_failedInit(self):
        """
        If C{inotify_init} returns a negative number, L{init} raises
        L{INotifyError}.
        """
        class libc:
            def inotify_init(self):
                return -1
        self.patch(_inotify, 'libc', libc())
        self.assertRaises(INotifyError, init)

        If C{inotify_init} returns a negative number, L{init} raises
        L{INotifyError}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/test/test_inotify.py