File tree Expand file tree Collapse file tree
pytest_doctestplus/sphinx Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010tests.
1111"""
1212import re
13- from docutils .nodes import literal_block
1413from docutils .parsers .rst import Directive
15-
14+ from sphinx . util . docutils import SphinxDirective
1615
1716class NoRunDirective (Directive ):
1817 def run (self ):
1918 # Simply do not add any content when this directive is encountered
2019 return []
2120
2221
23- class DoctestSkipDirective (Directive ):
22+ class DoctestSkipDirective (SphinxDirective ):
2423 has_content = True
2524
2625 def run (self ):
2726 # Check if there is any valid argument, and skip it. Currently only
2827 # 'win32' is supported.
2928 if len (self .content ) > 0 and re .match ("win32" , self .content [0 ]):
3029 self .content = self .content [2 :]
31- code = '\n ' .join (self .content )
32- return [literal_block (code , code )]
3330
31+ nodes = self .parse_content_to_nodes ()
32+ return nodes
3433
3534class DoctestOmitDirective (NoRunDirective ):
3635 has_content = True
You can’t perform that action at this time.
0 commit comments