@@ -33,9 +33,10 @@ def test_snippets_rst(
3333 builder .src_path .joinpath ("index.rst" ).write_text (content , encoding = "utf8" )
3434 write_assets (builder .src_path )
3535 builder .build ()
36- pformat = builder .get_doctree ("index" ).pformat ()
36+ doctree = builder .get_doctree ("index" , post_transforms = False )
37+ doctree .attributes .pop ("translation_progress" , None ) # added in sphinx 7.1
3738 file_regression .check (
38- pformat ,
39+ doctree . pformat () ,
3940 basename = f"snippet_pre_{ path .name [:- len (path .suffix )]} " ,
4041 extension = ".xml" ,
4142 encoding = "utf8" ,
@@ -56,8 +57,10 @@ def test_snippets_myst(
5657 builder .src_path .joinpath ("index.md" ).write_text (content , encoding = "utf8" )
5758 write_assets (builder .src_path )
5859 builder .build ()
60+ doctree = builder .get_doctree ("index" , post_transforms = False )
61+ doctree .attributes .pop ("translation_progress" , None ) # added in sphinx 7.1
5962 file_regression .check (
60- builder . get_doctree ( "index" ) .pformat (),
63+ doctree .pformat (),
6164 basename = f"snippet_pre_{ path .name [:- len (path .suffix )]} " ,
6265 extension = ".xml" ,
6366 encoding = "utf8" ,
@@ -78,9 +81,10 @@ def test_snippets_rst_post(
7881 builder .src_path .joinpath ("index.rst" ).write_text (content , encoding = "utf8" )
7982 write_assets (builder .src_path )
8083 builder .build ()
81- pformat = builder .get_doctree ("index" , post_transforms = True ).pformat ()
84+ doctree = builder .get_doctree ("index" , post_transforms = True )
85+ doctree .attributes .pop ("translation_progress" , None ) # added in sphinx 7.1
8286 file_regression .check (
83- pformat ,
87+ doctree . pformat () ,
8488 basename = f"snippet_post_{ path .name [:- len (path .suffix )]} " ,
8589 extension = ".xml" ,
8690 encoding = "utf8" ,
@@ -101,8 +105,10 @@ def test_snippets_myst_post(
101105 builder .src_path .joinpath ("index.md" ).write_text (content , encoding = "utf8" )
102106 write_assets (builder .src_path )
103107 builder .build ()
108+ doctree = builder .get_doctree ("index" , post_transforms = True )
109+ doctree .attributes .pop ("translation_progress" , None ) # added in sphinx 7.1
104110 file_regression .check (
105- builder . get_doctree ( "index" , post_transforms = True ) .pformat (),
111+ doctree .pformat (),
106112 basename = f"snippet_post_{ path .name [:- len (path .suffix )]} " ,
107113 extension = ".xml" ,
108114 encoding = "utf8" ,
@@ -117,8 +123,10 @@ def test_sd_hide_title_rst(
117123 content = ":sd_hide_title:\n \n Heading\n -------\n \n content"
118124 builder .src_path .joinpath ("index.rst" ).write_text (content , encoding = "utf8" )
119125 builder .build ()
126+ doctree = builder .get_doctree ("index" , post_transforms = False )
127+ doctree .attributes .pop ("translation_progress" , None ) # added in sphinx 7.1
120128 file_regression .check (
121- builder . get_doctree ( "index" , post_transforms = False ) .pformat (),
129+ doctree .pformat (),
122130 basename = "sd_hide_title" ,
123131 extension = ".xml" ,
124132 encoding = "utf8" ,
@@ -133,8 +141,10 @@ def test_sd_hide_title_myst(
133141 content = "---\n sd_hide_title: true\n ---\n \n # Heading\n \n content"
134142 builder .src_path .joinpath ("index.md" ).write_text (content , encoding = "utf8" )
135143 builder .build ()
144+ doctree = builder .get_doctree ("index" , post_transforms = False )
145+ doctree .attributes .pop ("translation_progress" , None ) # added in sphinx 7.1
136146 file_regression .check (
137- builder . get_doctree ( "index" , post_transforms = False ) .pformat (),
147+ doctree .pformat (),
138148 basename = "sd_hide_title" ,
139149 extension = ".xml" ,
140150 encoding = "utf8" ,
0 commit comments