File: fix-tests-for-sphinx-1.8.patch

package info (click to toggle)
sphinxcontrib-programoutput 0.11-3.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 240 kB
  • sloc: python: 745; makefile: 33
file content (38 lines) | stat: -rw-r--r-- 1,796 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--- sphinxcontrib-programoutput-0.11.orig/src/sphinxcontrib/programoutput/tests/__init__.py
+++ sphinxcontrib-programoutput-0.11/src/sphinxcontrib/programoutput/tests/__init__.py
@@ -3,7 +3,7 @@ import os.path
 import shutil
 import tempfile
 
-from docutils.parsers.rst import directives
+from docutils.parsers.rst import directives, roles
 from sphinx.application import Sphinx
 
 from functools import update_wrapper
@@ -60,9 +60,12 @@ class AppMixin(object):
         # sphinxcontrib.programoutput: directive u'program-output' is
         # already registered, it will be overridden".
         self.directives = directives._directives.copy()
+        # Likewise for 'eq'
+        self.roles = roles._roles.copy()
 
     def tearDown(self):
         directives._directives = self.directives
+        roles._roles = self.roles
 
     @Lazy
     def tmpdir(self):
--- sphinxcontrib-programoutput-0.11.orig/src/sphinxcontrib/programoutput/__init__.py
+++ sphinxcontrib-programoutput-0.11/src/sphinxcontrib/programoutput/__init__.py
@@ -218,6 +218,11 @@ def run_programs(app, doctree):
             error_message = 'Command {0} failed: {1}'.format(command, error)
             error_node = doctree.reporter.error(error_message, base_node=node)
             node.replace_self(error_node)
+            # Sphinx 1.8.0b1 started dropping all system_message nodes with a
+            # level less than 5 by default (or 2 if `keep_warnings` is set to true).
+            # This appears to be undocumented. Reporting failures is an important
+            # part of what this extension does, so we raise the default level.
+            error_node['level'] = 6
         else:
             if returncode != node['returncode']:
                 app.warn('Unexpected return code {0} from command {1}'.format(