Skip to content

Commit

Permalink
parametrize check tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samypr100 committed Jun 12, 2023
1 parent 0affebf commit 275ff17
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/console/commands/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ def test_check_private(
assert tester.io.fetch_output() == expected


@pytest.mark.parametrize("options", ["", "--lock"])
def test_check_lock_outdated(
command_tester_factory: CommandTesterFactory,
poetry_with_outdated_lockfile: Poetry,
http: type[httpretty.httpretty],
options: str,
) -> None:
http.disable()

Expand All @@ -127,7 +129,7 @@ def test_check_lock_outdated(
poetry_with_outdated_lockfile.set_locker(locker)

tester = command_tester_factory("check", poetry=poetry_with_outdated_lockfile)
status_code = tester.execute("--lock")
status_code = tester.execute(options)
expected = (
"Error: poetry.lock is not consistent with pyproject.toml. "
"Run `poetry lock [--no-update]` to fix it.\n"
Expand All @@ -139,10 +141,12 @@ def test_check_lock_outdated(
assert status_code == 1


@pytest.mark.parametrize("options", ["", "--lock"])
def test_check_lock_up_to_date(
command_tester_factory: CommandTesterFactory,
poetry_with_up_to_date_lockfile: Poetry,
http: type[httpretty.httpretty],
options: str,
) -> None:
http.disable()

Expand All @@ -153,7 +157,7 @@ def test_check_lock_up_to_date(
poetry_with_up_to_date_lockfile.set_locker(locker)

tester = command_tester_factory("check", poetry=poetry_with_up_to_date_lockfile)
status_code = tester.execute("--lock")
status_code = tester.execute(options)
expected = "All set!\n"
assert tester.io.fetch_output() == expected

Expand Down

0 comments on commit 275ff17

Please sign in to comment.