Skip to content

Commit

Permalink
Merge pull request #93 from smkent/pytest-bikeshed
Browse files Browse the repository at this point in the history
Replace pytest `ids` list with `pytest.param` instances
  • Loading branch information
smkent authored Jul 11, 2023
2 parents f727fd6 + eae645f commit 6583fd6
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_app_error(
@pytest.mark.parametrize(
["argv", "expected_args"],
[
(
pytest.param(
[],
dict(
send_email=True,
Expand All @@ -64,8 +64,9 @@ def test_app_error(
dry_run=False,
max_clip_count=0,
),
id="Default values",
),
(
pytest.param(
["-d", "-d", "-SS"],
dict(
send_email=True,
Expand All @@ -76,8 +77,9 @@ def test_app_error(
dry_run=False,
max_clip_count=0,
),
id="Debug and sleep levels 2",
),
(
pytest.param(
["--sendmail", "/my/special/sendmail"],
dict(
send_email=True,
Expand All @@ -88,8 +90,9 @@ def test_app_error(
dry_run=False,
max_clip_count=0,
),
id="Custom sendmail",
),
(
pytest.param(
[
"--sendmail",
(
Expand All @@ -110,8 +113,9 @@ def test_app_error(
dry_run=False,
max_clip_count=0,
),
id="Custom sendmail with arguments",
),
(
pytest.param(
["-n"],
dict(
send_email=False,
Expand All @@ -122,8 +126,9 @@ def test_app_error(
dry_run=False,
max_clip_count=0,
),
id="No email",
),
(
pytest.param(
["-p", "--max-clip", "42"],
dict(
send_email=True,
Expand All @@ -134,16 +139,9 @@ def test_app_error(
dry_run=True,
max_clip_count=42,
),
id="Dry run and max clip count",
),
],
ids=[
"Default values",
"Debug and sleep levels 2",
"Custom sendmail",
"Custom sendmail with arguments",
"No email",
"Dry run and max clip count",
],
)
def test_args(
mocker: pytest_mock.MockerFixture,
Expand Down

0 comments on commit 6583fd6

Please sign in to comment.