Skip to content
Snippets Groups Projects
Commit 10261529 authored by Bienchen's avatar Bienchen Committed by BIOPZ-Johner Niklaus
Browse files

Sobering up doctests

parent 562acc68
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,11 @@ Messages ...@@ -26,6 +26,11 @@ Messages
else: else:
raise raise
.. testoutput:: helper
:hide:
Something failed!
.. doctest:: helper .. doctest:: helper
from promod3.core import helper from promod3.core import helper
......
...@@ -283,6 +283,23 @@ doctest_global_setup = """ ...@@ -283,6 +283,23 @@ doctest_global_setup = """
import sys import sys
sys.path.insert(0, '@LIB_STAGE_PATH@/python@PYTHON_VERSION@/site-packages') sys.path.insert(0, '@LIB_STAGE_PATH@/python@PYTHON_VERSION@/site-packages')
sys.path.insert(1, '@OST_ROOT@/@LIB_DIR@/python@PYTHON_VERSION@/site-packages') sys.path.insert(1, '@OST_ROOT@/@LIB_DIR@/python@PYTHON_VERSION@/site-packages')
import ost
# We define a LogSink here, pushing everything to stdout so doctest recognises
# it.
class DocTestLogger(ost.LogSink):
def __init__(self):
ost.LogSink.__init__(self)
def LogMessage(self, message, severity):
levels = ['ERROR', 'WARNING', 'SCRIPT', 'INFO', 'VERBOSE', 'DEBUG',
'TRACE']
level = levels[severity]
print '%s' % (message),
doctest_logger = DocTestLogger()
ost.PushLogSink(doctest_logger)
""" """
# LocalWords: cmake # LocalWords: cmake
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment