diff --git a/Code/Mantid/docs/sphinxext/mantiddoc/doctest.py b/Code/Mantid/docs/sphinxext/mantiddoc/doctest.py index 78c1ae72def8..9758f0fa5f7f 100644 --- a/Code/Mantid/docs/sphinxext/mantiddoc/doctest.py +++ b/Code/Mantid/docs/sphinxext/mantiddoc/doctest.py @@ -511,11 +511,15 @@ def doctest_to_xunit(app, exception): Arguments: app (Sphinx.application): Sphinx application object - exception: (Exception): If an exception was raised then it is given here + exception: (Exception): If an exception was raised then it is given here. + It is simply re-raised if an error occurred """ + if exception: + raise exception if app.builder.name != "doctest": app.debug("Skipping xunit parsing for builder '%s'" % app.builder.name) return + import os doctest_file = os.path.join(app.builder.outdir, DOCTEST_OUTPUT)