summaryrefslogtreecommitdiff
path: root/tests/test_build_html.py
diff options
context:
space:
mode:
authordanieleades <33452915+danieleades@users.noreply.github.com>2022-07-12 22:55:57 +0100
committerGitHub <noreply@github.com>2022-07-12 22:55:57 +0100
commit25d379fb531a6f54b000b4047a112aa3aa858175 (patch)
tree5228f8d2fc73ce109b89a3a2d678b97418f310c0 /tests/test_build_html.py
parent69824f9265a5b77323734343b9cd23a4dad24f25 (diff)
downloadsphinx-git-25d379fb531a6f54b000b4047a112aa3aa858175.tar.gz
Lint with `flake8-bugbear` (#10602)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Diffstat (limited to 'tests/test_build_html.py')
-rw-r--r--tests/test_build_html.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index f9913a3cc..70141497b 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -79,7 +79,7 @@ def tail_check(check):
for node in nodes:
if node.tail and rex.search(node.tail):
return True
- assert False, '%r not found in tail of any nodes %s' % (check, nodes)
+ raise AssertionError('%r not found in tail of any nodes %s' % (check, nodes))
return checker
@@ -114,9 +114,9 @@ def check_xpath(etree, fname, path, check, be_found=True):
if all(not rex.search(get_text(node)) for node in nodes):
return
- assert False, ('%r not found in any node matching '
- 'path %s in %s: %r' % (check, path, fname,
- [node.text for node in nodes]))
+ raise AssertionError(('%r not found in any node matching '
+ 'path %s in %s: %r' % (check, path, fname,
+ [node.text for node in nodes])))
@pytest.mark.sphinx('html', testroot='warnings')
@@ -1520,7 +1520,7 @@ def test_html_math_renderer_is_duplicated(make_app, app_params):
try:
args, kwargs = app_params
make_app(*args, **kwargs)
- assert False
+ raise AssertionError()
except ConfigError as exc:
assert str(exc) == ('Many math_renderers are registered. '
'But no math_renderer is selected.')
@@ -1550,7 +1550,7 @@ def test_html_math_renderer_is_mismatched(make_app, app_params):
try:
args, kwargs = app_params
make_app(*args, **kwargs)
- assert False
+ raise AssertionError()
except ConfigError as exc:
assert str(exc) == "Unknown math_renderer 'imgmath' is given."