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

Error if the --python option is specified after the subcommand name #12068

Merged
merged 5 commits into from
Jun 8, 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
Add a test for the error
  • Loading branch information
pfmoore committed Jun 5, 2023
commit 16f145d30657093dab2fe66cd3695d248c46db45
11 changes: 11 additions & 0 deletions tests/functional/test_python_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,14 @@ def test_python_interpreter(
script.pip("--python", env_path, "uninstall", "simplewheel", "--yes")
result = script.pip("--python", env_path, "list", "--format=json")
assert json.loads(result.stdout) == before

def test_error_python_option_wrong_location(
script: PipTestEnvironment,
tmpdir: Path,
shared_data: TestData,
) -> None:
env_path = os.fspath(tmpdir / "venv")
env = EnvBuilder(with_pip=False)
env.create(env_path)

script.pip("list", "--python", env_path, "--format=json", expect_error=True)