File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,16 +38,16 @@ def parse_rst(content: str) -> nodes.document:
3838 with in_tempdir ():
3939 doctree = run_sphinx (content , buildername = "dummy" , extensions = [])
4040 fix_node_lines (doctree )
41- save_test_doctree (doctree )
41+ if SAVE_INTERMEDIATE :
42+ save_test_doctree (doctree )
4243 return doctree
4344
4445
4546def save_test_doctree (doctree : nodes .document ) -> None :
46- if SAVE_INTERMEDIATE :
47- dump_file = Path (f"tmp/doctree/{ slug_for_test ()} .txt" )
48- dump_file .parent .mkdir (parents = True , exist_ok = True )
49- with dump_file .open ("w" , encoding = "utf-8" ) as f :
50- dump_doctree (doctree , f )
47+ dump_file = Path (f"tmp/doctree/{ slug_for_test ()} .txt" )
48+ dump_file .parent .mkdir (parents = True , exist_ok = True )
49+ with dump_file .open ("w" , encoding = "utf-8" ) as f :
50+ dump_doctree (doctree , f )
5151
5252
5353BLOCK_NODES = (nodes .paragraph ,)
Original file line number Diff line number Diff line change @@ -43,8 +43,8 @@ def test_summarize_html(rst_file: str) -> None:
4343 (PROJECT / f"tmp/html/{ root } _summary_nofix.html" ).write_text (
4444 nofix_summary , encoding = "utf-8"
4545 )
46+ save_test_doctree (doctree )
4647
47- save_test_doctree (doctree )
4848 assert 'class="self-link"' not in summary , f"Self-links found in { root } .html"
4949 summary_file = PROJECT / f"tests/data/{ root } _summary.html"
5050 if summary_file .exists ():
You can’t perform that action at this time.
0 commit comments