14
14
minversion = None if sys .version_info < (3 , 10 ) else '4.1.3' )
15
15
16
16
17
- def test_tinypages (tmpdir ):
18
- source_dir = Path ( tmpdir ) / 'src'
17
+ def test_tinypages (tmp_path ):
18
+ source_dir = tmp_path / 'src'
19
19
shutil .copytree (Path (__file__ ).parent / 'tinypages' , source_dir )
20
20
html_dir = source_dir / '_build' / 'html'
21
21
doctree_dir = source_dir / 'doctrees'
@@ -98,8 +98,8 @@ def plot_directive_file(num):
98
98
assert filecmp .cmp (range_6 , plot_file (5 ))
99
99
100
100
101
- def test_plot_html_show_source_link (tmpdir ):
102
- source_dir = Path ( tmpdir ) / 'src'
101
+ def test_plot_html_show_source_link (tmp_path ):
102
+ source_dir = tmp_path / 'src'
103
103
source_dir .mkdir ()
104
104
parent = Path (__file__ ).parent
105
105
shutil .copyfile (parent / 'tinypages/conf.py' , source_dir / 'conf.py' )
@@ -123,10 +123,10 @@ def test_plot_html_show_source_link(tmpdir):
123
123
124
124
125
125
@pytest .mark .parametrize ('plot_html_show_source_link' , [0 , 1 ])
126
- def test_show_source_link_true (tmpdir , plot_html_show_source_link ):
126
+ def test_show_source_link_true (tmp_path , plot_html_show_source_link ):
127
127
# Test that a source link is generated if :show-source-link: is true,
128
128
# whether or not plot_html_show_source_link is true.
129
- source_dir = Path ( tmpdir ) / 'src'
129
+ source_dir = tmp_path / 'src'
130
130
source_dir .mkdir ()
131
131
parent = Path (__file__ ).parent
132
132
shutil .copyfile (parent / 'tinypages/conf.py' , source_dir / 'conf.py' )
@@ -145,10 +145,10 @@ def test_show_source_link_true(tmpdir, plot_html_show_source_link):
145
145
146
146
147
147
@pytest .mark .parametrize ('plot_html_show_source_link' , [0 , 1 ])
148
- def test_show_source_link_false (tmpdir , plot_html_show_source_link ):
148
+ def test_show_source_link_false (tmp_path , plot_html_show_source_link ):
149
149
# Test that a source link is NOT generated if :show-source-link: is false,
150
150
# whether or not plot_html_show_source_link is true.
151
- source_dir = Path ( tmpdir ) / 'src'
151
+ source_dir = tmp_path / 'src'
152
152
source_dir .mkdir ()
153
153
parent = Path (__file__ ).parent
154
154
shutil .copyfile (parent / 'tinypages/conf.py' , source_dir / 'conf.py' )
0 commit comments