Re-enable doctests for the quicktour (#15828)
* Re-enable doctests for the quicktour * Re-enable doctests for task_summary (#15830) * Remove &
This commit is contained in:
15
conftest.py
15
conftest.py
@@ -15,6 +15,7 @@
|
||||
# tests directory-specific settings - this file is run automatically
|
||||
# by pytest before any tests are run
|
||||
|
||||
import doctest
|
||||
import sys
|
||||
import warnings
|
||||
from os.path import abspath, dirname, join
|
||||
@@ -59,3 +60,17 @@ def pytest_sessionfinish(session, exitstatus):
|
||||
# If no tests are collected, pytest exists with code 5, which makes the CI fail.
|
||||
if exitstatus == 5:
|
||||
session.exitstatus = 0
|
||||
|
||||
|
||||
# Doctest custom flag to ignore output.
|
||||
IGNORE_RESULT = doctest.register_optionflag('IGNORE_RESULT')
|
||||
|
||||
OutputChecker = doctest.OutputChecker
|
||||
|
||||
class CustomOutputChecker(OutputChecker):
|
||||
def check_output(self, want, got, optionflags):
|
||||
if IGNORE_RESULT and optionflags:
|
||||
return True
|
||||
return OutputChecker.check_output(self, want, got, optionflags)
|
||||
|
||||
doctest.OutputChecker = CustomOutputChecker
|
||||
|
||||
Reference in New Issue
Block a user