def test_closeNoWrite(self):
        """
        Closing a file which was open for reading but not writing in a
        monitored directory sends an C{inotify.IN_CLOSE_NOWRITE} event
        to the callback.
        """
        def operation(path):
            path.touch()
            path.open("r").close()

        return self._notificationTest(inotify.IN_CLOSE_NOWRITE, operation)

        Closing a file which was open for reading but not writing in a
        monitored directory sends an C{inotify.IN_CLOSE_NOWRITE} event
        to the callback.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_inotify.py