def test_nonExistentDir(self):
        """
        Specifying an invalid directory to L{LogFile} raises C{IOError}.
        """
        e = self.assertRaises(
            IOError, logfile.LogFile, self.name, 'this_dir_does_not_exist')
        self.assertEqual(e.errno, errno.ENOENT)

        Specifying an invalid directory to L{LogFile} raises C{IOError}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_logfile.py