Skip to content

Commit cfda0e2

Browse files
committed
Add tests
1 parent becdd56 commit cfda0e2

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

Diff for: tests/conftest.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import pytest
2+
3+
4+
@pytest.fixture(
5+
params=[
6+
[],
7+
["--numprocesses", "auto"],
8+
],
9+
ids=["no_plugin", "with_xdist"],
10+
)
11+
def plugin_args(request: pytest.FixtureRequest) -> list[str]:
12+
"""Fixture to test with various plugins"""
13+
return request.param

Diff for: tests/integration/test_snapshot_option_warn_unused.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ def run_testcases(testdir, testcases):
2828
return testdir, testcases
2929

3030

31-
def test_unused_snapshots_failure(run_testcases):
31+
def test_unused_snapshots_failure(run_testcases, plugin_args):
3232
testdir, testcases = run_testcases
3333
testdir.makepyfile(test_file=testcases["used"])
3434

35-
result = testdir.runpytest("-v")
35+
result = testdir.runpytest("-v", *plugin_args)
3636
result.stdout.re_match_lines(
3737
(
3838
r"1 snapshot passed\. 1 snapshot unused\.",
@@ -42,11 +42,11 @@ def test_unused_snapshots_failure(run_testcases):
4242
assert result.ret == 1
4343

4444

45-
def test_unused_snapshots_warning(run_testcases):
45+
def test_unused_snapshots_warning(run_testcases, plugin_args):
4646
testdir, testcases = run_testcases
4747
testdir.makepyfile(test_file=testcases["used"])
4848

49-
result = testdir.runpytest("-v", "--snapshot-warn-unused")
49+
result = testdir.runpytest("-v", "--snapshot-warn-unused", *plugin_args)
5050
result.stdout.re_match_lines(
5151
(
5252
r"1 snapshot passed\. 1 snapshot unused\.",
@@ -56,11 +56,11 @@ def test_unused_snapshots_warning(run_testcases):
5656
assert result.ret == 0
5757

5858

59-
def test_unused_snapshots_deletion(run_testcases):
59+
def test_unused_snapshots_deletion(run_testcases, plugin_args):
6060
testdir, testcases = run_testcases
6161
testdir.makepyfile(test_file=testcases["used"])
6262

63-
result = testdir.runpytest("-v", "--snapshot-update")
63+
result = testdir.runpytest("-v", "--snapshot-update", *plugin_args)
6464
result.stdout.re_match_lines(
6565
(
6666
r"1 snapshot passed\. 1 unused snapshot deleted\.",

0 commit comments

Comments
 (0)