@@ -147,8 +147,9 @@ def test_run_benchmarks(benchmarks_checkout):
147
147
assert returncode == 1
148
148
149
149
150
- def test_should_run_exists_noforce (benchmarks_checkout , capsys ):
150
+ def test_should_run_exists_noforce (benchmarks_checkout , capsys , monkeypatch ):
151
151
repo = _copy_repo (benchmarks_checkout )
152
+ monkeypatch .chdir (repo )
152
153
153
154
should_run ._main (
154
155
False ,
@@ -166,8 +167,9 @@ def test_should_run_exists_noforce(benchmarks_checkout, capsys):
166
167
assert (repo / "results" / "bm-20220323-3.10.4-9d38120" ).is_dir ()
167
168
168
169
169
- def test_should_run_diff_machine_noforce (benchmarks_checkout , capsys ):
170
+ def test_should_run_diff_machine_noforce (benchmarks_checkout , capsys , monkeypatch ):
170
171
repo = _copy_repo (benchmarks_checkout )
172
+ monkeypatch .chdir (repo )
171
173
172
174
should_run ._main (
173
175
False ,
@@ -185,8 +187,9 @@ def test_should_run_diff_machine_noforce(benchmarks_checkout, capsys):
185
187
assert len (list ((repo / "results" / "bm-20220323-3.10.4-9d38120" ).iterdir ())) == 1
186
188
187
189
188
- def test_should_run_all_noforce (benchmarks_checkout , capsys ):
190
+ def test_should_run_all_noforce (benchmarks_checkout , capsys , monkeypatch ):
189
191
repo = _copy_repo (benchmarks_checkout )
192
+ monkeypatch .chdir (repo )
190
193
191
194
should_run ._main (
192
195
False ,
@@ -204,8 +207,9 @@ def test_should_run_all_noforce(benchmarks_checkout, capsys):
204
207
assert len (list ((repo / "results" / "bm-20220323-3.10.4-9d38120" ).iterdir ())) == 1
205
208
206
209
207
- def test_should_run_noexists_noforce (benchmarks_checkout , capsys ):
210
+ def test_should_run_noexists_noforce (benchmarks_checkout , capsys , monkeypatch ):
208
211
repo = _copy_repo (benchmarks_checkout )
212
+ monkeypatch .chdir (repo )
209
213
shutil .rmtree (repo / "results" / "bm-20220323-3.10.4-9d38120" )
210
214
211
215
should_run ._main (
@@ -226,6 +230,7 @@ def test_should_run_noexists_noforce(benchmarks_checkout, capsys):
226
230
227
231
def test_should_run_exists_force (benchmarks_checkout , capsys , monkeypatch ):
228
232
repo = _copy_repo (benchmarks_checkout )
233
+ monkeypatch .chdir (repo )
229
234
230
235
removed_paths = []
231
236
@@ -253,14 +258,15 @@ def remove(repo, path):
253
258
assert captured .out .splitlines ()[- 1 ].strip () == "should_run=true"
254
259
assert (repo / "results" / "bm-20220323-3.10.4-9d38120" ).is_dir ()
255
260
assert set (x .name for x in removed_paths ) == {
256
- "bm-20220323-linux-x86_64-python-main-3.10.4-9d38120-vs-3.11.0b3.png " ,
261
+ "bm-20220323-linux-x86_64-python-main-3.10.4-9d38120-vs-3.11.0b3.svg " ,
257
262
"README.md" ,
258
263
"bm-20220323-linux-x86_64-python-main-3.10.4-9d38120-vs-3.11.0b3.md" ,
259
264
}
260
265
261
266
262
- def test_should_run_noexists_force (benchmarks_checkout , capsys ):
267
+ def test_should_run_noexists_force (benchmarks_checkout , capsys , monkeypatch ):
263
268
repo = _copy_repo (benchmarks_checkout )
269
+ monkeypatch .chdir (repo )
264
270
shutil .rmtree (repo / "results" / "bm-20220323-3.10.4-9d38120" )
265
271
266
272
should_run ._main (
@@ -279,8 +285,9 @@ def test_should_run_noexists_force(benchmarks_checkout, capsys):
279
285
assert not (repo / "results" / "bm-20220323-3.10.4-9d38120" ).is_dir ()
280
286
281
287
282
- def test_should_run_checkout_failed (tmp_path , capsys ):
288
+ def test_should_run_checkout_failed (tmp_path , capsys , monkeypatch ):
283
289
repo = _copy_repo (tmp_path )
290
+ monkeypatch .chdir (repo )
284
291
cpython_path = tmp_path / "cpython"
285
292
cpython_path .mkdir ()
286
293
subprocess .check_call (["git" , "init" ], cwd = cpython_path )
0 commit comments