Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving "poetry lock --check" to "poetry check --lock" #8015

Merged
merged 17 commits into from
Jun 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
parametrize check tests
  • Loading branch information
samypr100 committed Jun 12, 2023
commit 275ff17fc269c79d21805b6f5e3c1a1850f8c808
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