@@ -184,17 +184,17 @@ def test_update_failure_shows_snapshot_diff(
184
184
185
185
186
186
def test_update_success_shows_snapshot_report (
187
- run_testcases , testcases_updated , plugin_args_fails_xdist
187
+ run_testcases , testcases_updated , plugin_args
188
188
):
189
189
testdir = run_testcases [1 ]
190
190
testdir .makepyfile (** testcases_updated )
191
- result = testdir .runpytest ("-v" , "--snapshot-update" , * plugin_args_fails_xdist )
191
+ result = testdir .runpytest ("-v" , "--snapshot-update" , * plugin_args )
192
192
result .stdout .re_match_lines ((r"5 snapshots passed\. 5 snapshots updated\." ))
193
193
assert result .ret == 0
194
194
195
195
196
196
def test_update_targets_only_selected_parametrized_tests_for_update_dash_m (
197
- run_testcases , plugin_args_fails_xdist
197
+ run_testcases , plugin_args
198
198
):
199
199
updated_tests = {
200
200
"test_used" : (
@@ -210,7 +210,7 @@ def test_used(snapshot, actual):
210
210
testdir = run_testcases [1 ]
211
211
testdir .makepyfile (** updated_tests )
212
212
result = testdir .runpytest (
213
- "-v" , "--snapshot-update" , * plugin_args_fails_xdist , "-m" , "parametrize"
213
+ "-v" , "--snapshot-update" , * plugin_args , "-m" , "parametrize"
214
214
)
215
215
result .stdout .re_match_lines (
216
216
(
@@ -224,7 +224,7 @@ def test_used(snapshot, actual):
224
224
225
225
226
226
def test_update_targets_only_selected_parametrized_tests_for_update_dash_k (
227
- run_testcases , plugin_args_fails_xdist
227
+ run_testcases , plugin_args
228
228
):
229
229
updated_tests = {
230
230
"test_used" : (
@@ -240,7 +240,7 @@ def test_used(snapshot, actual):
240
240
testdir = run_testcases [1 ]
241
241
testdir .makepyfile (** updated_tests )
242
242
result = testdir .runpytest (
243
- "-v" , "--snapshot-update" , * plugin_args_fails_xdist , "-k" , "test_used[2]"
243
+ "-v" , "--snapshot-update" , * plugin_args , "-k" , "test_used[2]"
244
244
)
245
245
result .stdout .re_match_lines ((r"1 snapshot updated\." ))
246
246
assert "Deleted" not in result .stdout .str ()
@@ -250,7 +250,7 @@ def test_used(snapshot, actual):
250
250
251
251
252
252
def test_update_targets_only_selected_parametrized_tests_for_removal_dash_k (
253
- run_testcases , plugin_args_fails_xdist
253
+ run_testcases , plugin_args
254
254
):
255
255
updated_tests = {
256
256
"test_used" : (
@@ -266,7 +266,7 @@ def test_used(snapshot, actual):
266
266
testdir = run_testcases [1 ]
267
267
testdir .makepyfile (** updated_tests )
268
268
result = testdir .runpytest (
269
- "-v" , "--snapshot-update" , * plugin_args_fails_xdist , "-k" , "test_used["
269
+ "-v" , "--snapshot-update" , * plugin_args , "-k" , "test_used["
270
270
)
271
271
result .stdout .re_match_lines (
272
272
(
@@ -279,9 +279,7 @@ def test_used(snapshot, actual):
279
279
assert Path (* snapshot_path , "test_updated_1.ambr" ).exists ()
280
280
281
281
282
- def test_update_targets_only_selected_class_tests_dash_k (
283
- testdir , plugin_args_fails_xdist
284
- ):
282
+ def test_update_targets_only_selected_class_tests_dash_k (testdir , plugin_args ):
285
283
test_content = """
286
284
import pytest
287
285
@@ -298,15 +296,13 @@ def test_case_2(self, snapshot):
298
296
assert Path (testdir .tmpdir , "__snapshots__" , "test_content.ambr" ).exists ()
299
297
300
298
result = testdir .runpytest (
301
- "test_content.py" , "-v" , * plugin_args_fails_xdist , "-k" , "test_case_2"
299
+ "test_content.py" , "-v" , * plugin_args , "-k" , "test_case_2"
302
300
)
303
301
result .stdout .re_match_lines ((r"1 snapshot passed\." ))
304
302
assert "snaphot unused" not in result .stdout .str ()
305
303
306
304
307
- def test_update_targets_only_selected_module_tests_dash_k (
308
- testdir , plugin_args_fails_xdist
309
- ):
305
+ def test_update_targets_only_selected_module_tests_dash_k (testdir , plugin_args ):
310
306
test_content = """
311
307
import pytest
312
308
@@ -322,21 +318,19 @@ def test_case_2(snapshot):
322
318
assert Path (testdir .tmpdir , "__snapshots__" , "test_content.ambr" ).exists ()
323
319
324
320
result = testdir .runpytest (
325
- "test_content.py" , "-v" , * plugin_args_fails_xdist , "-k" , "test_case_2"
321
+ "test_content.py" , "-v" , * plugin_args , "-k" , "test_case_2"
326
322
)
327
323
result .stdout .re_match_lines ((r"1 snapshot passed\." ))
328
324
assert "snaphot unused" not in result .stdout .str ()
329
325
330
326
331
- def test_update_targets_only_selected_module_tests_nodes (
332
- run_testcases , plugin_args_fails_xdist
333
- ):
327
+ def test_update_targets_only_selected_module_tests_nodes (run_testcases , plugin_args ):
334
328
testdir = run_testcases [1 ]
335
329
snapfile_empty = Path ("__snapshots__" , "empty_snapfile.ambr" )
336
330
testdir .makefile (".ambr" , ** {str (snapfile_empty ): "" })
337
331
testfile = Path (testdir .tmpdir , "test_used.py" )
338
332
result = testdir .runpytest (
339
- "-v" , f"{ testfile } ::test_used" , "--snapshot-update" , * plugin_args_fails_xdist
333
+ "-v" , f"{ testfile } ::test_used" , "--snapshot-update" , * plugin_args
340
334
)
341
335
result .stdout .re_match_lines ((r"3 snapshots passed\." ))
342
336
assert "unused" not in result .stdout .str ()
@@ -368,7 +362,7 @@ def test_update_targets_only_selected_module_tests_nodes_pyargs(
368
362
369
363
370
364
def test_update_targets_only_selected_module_tests_file_for_update (
371
- run_testcases , plugin_args_fails_xdist
365
+ run_testcases , plugin_args
372
366
):
373
367
testdir = run_testcases [1 ]
374
368
snapfile_empty = Path ("__snapshots__" , "empty_snapfile.ambr" )
@@ -384,9 +378,7 @@ def test_used(snapshot, actual):
384
378
"""
385
379
)
386
380
)
387
- result = testdir .runpytest (
388
- "-v" , "test_used.py" , "--snapshot-update" , * plugin_args_fails_xdist
389
- )
381
+ result = testdir .runpytest ("-v" , "test_used.py" , "--snapshot-update" , * plugin_args )
390
382
result .stdout .re_match_lines (
391
383
(
392
384
r"3 snapshots passed\. 2 unused snapshots deleted\." ,
@@ -399,7 +391,7 @@ def test_used(snapshot, actual):
399
391
400
392
401
393
def test_update_targets_only_selected_module_tests_file_for_removal (
402
- run_testcases , plugin_args_fails_xdist
394
+ run_testcases , plugin_args
403
395
):
404
396
testdir = run_testcases [1 ]
405
397
testdir .makepyfile (
@@ -412,9 +404,7 @@ def test_used(snapshot):
412
404
)
413
405
snapfile_empty = Path ("__snapshots__" , "empty_snapfile.ambr" )
414
406
testdir .makefile (".ambr" , ** {str (snapfile_empty ): "" })
415
- result = testdir .runpytest (
416
- "-v" , "test_used.py" , "--snapshot-update" , * plugin_args_fails_xdist
417
- )
407
+ result = testdir .runpytest ("-v" , "test_used.py" , "--snapshot-update" , * plugin_args )
418
408
result .stdout .re_match_lines (
419
409
(
420
410
r"5 unused snapshots deleted\." ,
@@ -427,14 +417,12 @@ def test_used(snapshot):
427
417
assert not Path ("__snapshots__" , "test_used.ambr" ).exists ()
428
418
429
419
430
- def test_update_removes_empty_snapshot_collection_only (
431
- run_testcases , plugin_args_fails_xdist
432
- ):
420
+ def test_update_removes_empty_snapshot_collection_only (run_testcases , plugin_args ):
433
421
testdir = run_testcases [1 ]
434
422
snapfile_empty = Path ("__snapshots__" , "empty_snapfile.ambr" )
435
423
testdir .makefile (".ambr" , ** {str (snapfile_empty ): "" })
436
424
assert snapfile_empty .exists ()
437
- result = testdir .runpytest ("-v" , "--snapshot-update" , * plugin_args_fails_xdist )
425
+ result = testdir .runpytest ("-v" , "--snapshot-update" , * plugin_args )
438
426
result .stdout .re_match_lines (
439
427
(
440
428
r"10 snapshots passed\. 1 unused snapshot deleted\." ,
@@ -447,15 +435,13 @@ def test_update_removes_empty_snapshot_collection_only(
447
435
assert Path ("__snapshots__" , "test_used.ambr" ).exists ()
448
436
449
437
450
- def test_update_removes_hanging_snapshot_collection_file (
451
- run_testcases , plugin_args_fails_xdist
452
- ):
438
+ def test_update_removes_hanging_snapshot_collection_file (run_testcases , plugin_args ):
453
439
testdir = run_testcases [1 ]
454
440
snapfile_used = Path ("__snapshots__" , "test_used.ambr" )
455
441
snapfile_hanging = Path ("__snapshots__" , "hanging_snapfile.abc" )
456
442
testdir .makefile (".abc" , ** {str (snapfile_hanging ): "" })
457
443
assert snapfile_hanging .exists ()
458
- result = testdir .runpytest ("-v" , "--snapshot-update" , * plugin_args_fails_xdist )
444
+ result = testdir .runpytest ("-v" , "--snapshot-update" , * plugin_args )
459
445
result .stdout .re_match_lines (
460
446
(
461
447
r"10 snapshots passed\. 1 unused snapshot deleted\." ,
0 commit comments