Skip to content

Commit

Permalink
chore(pytest_sphinx): Fix assert
Browse files Browse the repository at this point in the history
B011 Do not call assert False since python -O removes these calls.
Instead callers should raise AssertionError().
  • Loading branch information
tony committed Sep 7, 2022
1 parent b361ead commit 7c5a929
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pytest_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def _DocTestRunner__run(self, test, compileflags, out):
self.report_unexpected_exception(out, test, example, exception)
failures += 1
else:
assert False, ("unknown outcome", outcome)
raise AssertionError(f"unknown outcome: {outcome}")

if failures and self.optionflags & doctest.FAIL_FAST:
break
Expand Down

0 comments on commit 7c5a929

Please sign in to comment.