@@ -26,7 +26,7 @@ def auto_build_and_check(
2626 request ,
2727):
2828 """
29- Build and check build success and output regressions.
29+ Build and check build success and output regressions.
3030 Currently all tests start with this.
3131 Disable using a `noautobuild` mark.
3232 """
@@ -80,12 +80,17 @@ def read(
8080 ):
8181 content = get_sphinx_app_output (app , buildername , filename , encoding )
8282
83- soup = BeautifulSoup (content , "html.parser" )
84- doc_div = soup .findAll ("div" , {"class" : "documentwrapper" })[0 ]
85- text = doc_div .prettify ()
86- for find , rep in (replace or {}).items ():
87- text = text .replace (find , rep )
88- file_regression .check (text , extension = ".html" , encoding = "utf8" )
83+ if buildername == "html" :
84+ soup = BeautifulSoup (content , "html.parser" )
85+ doc_div = soup .findAll ("div" , {"class" : "documentwrapper" })[0 ]
86+ doc = doc_div .prettify ()
87+ for find , rep in (replace or {}).items ():
88+ doc = text .replace (find , rep )
89+ else :
90+ doc = content
91+ file_regression .check (
92+ doc , extension = "." + filename .split ("." )[- 1 ], encoding = "utf8"
93+ )
8994
9095 return read
9196
0 commit comments