def METHOD_NAME(platform, expected_cause):
    with pytest.raises(
        Platform.InvalidPlatformError,
        match=(
            r".*{literal}.*".format(
                literal=re.escape(
                    dedent(
                        """\
                        Not a valid platform specifier: {platform}
                        {expected_cause}
                        """
                    ).format(platform=platform, expected_cause=expected_cause)
                )
            )
        ),
    ):
        Platform.create(platform)