@@ -100,19 +100,21 @@ def plot_directive_file(num):
100100def test_plot_html_show_source_link (tmpdir ):
101101 source_dir = Path (tmpdir ) / 'src'
102102 source_dir .mkdir ()
103- shutil .copyfile (Path (__file__ ).parent / 'tinypages/conf.py' , source_dir )
104- shutil .copytree (Path (__file__ ).parent / 'tinypages/_static' , source_dir )
103+ parent = Path (__file__ ).parent
104+ shutil .copyfile (parent / 'tinypages/conf.py' , source_dir / 'conf.py' )
105+ shutil .copytree (parent / 'tinypages/_static' , source_dir / '_static' )
105106 doctree_dir = source_dir / 'doctrees'
106107 (source_dir / 'index.rst' ).write_text ("""
107108.. plot::
108109
109- plt.plot(range(4 ))
110+ plt.plot(range(2 ))
110111""" )
111112 # Make sure source scripts are created by default
112113 html_dir1 = source_dir / '_build' / 'html1'
113114 build_sphinx_html (source_dir , doctree_dir , html_dir1 )
114115 assert "index-1.py" in [p .name for p in html_dir1 .iterdir ()]
115- # Make sure source scripts are NOT created when `plot_html_show_source_link` is False
116+ # Make sure source scripts are NOT created when
117+ # plot_html_show_source_link` is False
116118 html_dir2 = source_dir / '_build' / 'html2'
117119 build_sphinx_html (source_dir , doctree_dir , html_dir2 ,
118120 extra_args = ["-D" , "plot_html_show_source_link=0" ])
0 commit comments