summaryrefslogtreecommitdiff
path: root/sphinx/testing/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/testing/util.py')
-rw-r--r--sphinx/testing/util.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/testing/util.py b/sphinx/testing/util.py
index 441e6da3b..672cdba8f 100644
--- a/sphinx/testing/util.py
+++ b/sphinx/testing/util.py
@@ -24,17 +24,17 @@ __all__ = [
def assert_re_search(regex: Pattern, text: str, flags: int = 0) -> None:
if not re.search(regex, text, flags):
- assert False, '%r did not match %r' % (regex, text)
+ raise AssertionError('%r did not match %r' % (regex, text))
def assert_not_re_search(regex: Pattern, text: str, flags: int = 0) -> None:
if re.search(regex, text, flags):
- assert False, '%r did match %r' % (regex, text)
+ raise AssertionError('%r did match %r' % (regex, text))
def assert_startswith(thing: str, prefix: str) -> None:
if not thing.startswith(prefix):
- assert False, '%r does not start with %r' % (thing, prefix)
+ raise AssertionError('%r does not start with %r' % (thing, prefix))
def assert_node(node: Node, cls: Any = None, xpath: str = "", **kwargs: Any) -> None: