def test_readWithBogusPID(self):
        """
        L{PIDFile.read} raises L{InvalidPIDFileError} when given an empty file
        path.
        """
        pidValue = b"$foo!"
        pidFile = PIDFile(DummyFilePath(pidValue))

        e = self.assertRaises(InvalidPIDFileError, pidFile.read)
        self.assertEqual(
            str(e),
            "non-integer PID value in PID file: {!r}".format(pidValue)
        )

        L{PIDFile.read} raises L{InvalidPIDFileError} when given an empty file
        path.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/application/runner/test/test_pidfile.py