Skip to content

Commit

Permalink
Revert "Make SKIP behave like MOCK (#3)" (#4)
Browse files Browse the repository at this point in the history
This reverts commit 77ea922.

Signed-off-by: Balaji Veeramani <[email protected]>
  • Loading branch information
bveeramani authored Jun 13, 2023
1 parent 77ea922 commit ddf70b8
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/pytest_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ def _DocTestRunner__run(
else:
self.optionflags &= ~optionflag

# If 'SKIP' is set, then skip this example.
if self.optionflags & doctest.SKIP:
continue

# Record that we started this example.
tries += 1
if not quiet:
Expand Down Expand Up @@ -467,17 +471,9 @@ def _DocTestRunner__run(
# If the example executed without raising any exceptions,
# verify its output.
if exception is None:
# If 'SKIP' is set, run the example code but don't check the
# output. This is different than upstream `pytest-sphinx`, which skips
# the example entirely.
if self.optionflags & doctest.SKIP:
# If 'MOCK' is set, then don't check the output.
if self.optionflags & _MOCK:
outcome = SUCCESS

# 'MOCK' is deprecated in favor of 'SKIP'. Here for backwards
# compatibility.
elif self.optionflags & _MOCK:
outcome = SUCCESS

elif check(example.want, got, self.optionflags):
outcome = SUCCESS

Expand Down

0 comments on commit ddf70b8

Please sign in to comment.