From c83211b4fbd874848d5e8cf7c289599da38129f1 Mon Sep 17 00:00:00 2001 From: Gerardo Tauriello <gerardo.tauriello@unibas.ch> Date: Tue, 12 Jan 2016 16:43:48 +0100 Subject: [PATCH] Fixed randomly failing doctest --- actions/doc/index_dev.rst | 2 ++ doc/conf.py.in | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/actions/doc/index_dev.rst b/actions/doc/index_dev.rst index d88a7075..921bf324 100644 --- a/actions/doc/index_dev.rst +++ b/actions/doc/index_dev.rst @@ -265,6 +265,8 @@ To get the test for exit code ``0`` talking to you, just do .. testcode:: actiontest :hide: + # hack needed to see output + ost.PushVerbosityLevel(2) import unittest class DoAwesomeActionTests(test_actions.ActionTestCase): diff --git a/doc/conf.py.in b/doc/conf.py.in index f9a16c14..7d7c5d41 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -299,8 +299,10 @@ rst_epilog = """ # increase default timeout (5s) for linkcheck linkcheck_timeout = 15.0 -# in some versions of sphinx, doctest invokes doctest_path AFTER executing code +# global setup for doctests (will be executed before any testcode block) doctest_global_setup = """ +# in some versions of sphinx, doctest invokes doctest_path AFTER executing code +# hence we set paths here... import sys sys.path.insert(0, '@LIB_STAGE_PATH@/@PYTHON_MODULE_PATH@') sys.path.insert(1, '@OST_PYMOD_PATH@') @@ -322,6 +324,7 @@ class DocTestLogger(ost.LogSink): doctest_logger = DocTestLogger() ost.PushLogSink(doctest_logger) +ost.PushVerbosityLevel(0) """ # LocalWords: cmake -- GitLab