def test_removePIDErrors(self):
        """
        Calling L{UnixApplicationRunner.removePID} with a non-existent filename
        logs an OSError.
        """
        runner = UnixApplicationRunner({})
        runner.removePID("fakepid")
        errors = self.flushLoggedErrors(OSError)
        self.assertEqual(len(errors), 1)
        self.assertEqual(errors[0].value.errno, errno.ENOENT)

        Calling L{UnixApplicationRunner.removePID} with a non-existent filename
        logs an OSError.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_twistd.py