def assert_title(self, title, **kwargs):
query = TitleQuery(title, **kwargs)<EOL>@self.synchronize(wait=query.wait)<EOL>def assert_title():<EOL><INDENT>if not query.resolves_for(self):<EOL><INDENT>raise ExpectationNotMet(query.failure_message)<EOL><DEDENT>return True<EOL><DEDENT>return assert_title()<EOL>
Asserts that the page has the given title.

Args:
    title (str | RegexObject): The string or regex that the title should match.
    **kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.

Returns:
    True

Raises:
    ExpectationNotMet: If the assertion hasn't succeeded during the wait time.