def METHOD_NAME(self, *,
                 url: str,
                 expect_warnings: bool,
                 expect_errors: bool):
    """Checks that when parsed, the given url contains warnings and/or
    errors consistent with the expected conditions.
    """
    if expect_errors:
        with self.assertRaises(Exception):
            self._parse(url=url, strict=False)
        return
    if expect_warnings:
        self._parse(url=url, strict=False)
        with self.assertRaises(Exception):
            self._parse(url=url, strict=True)
        return
    self._parse(url=url, strict=True)