Skip to content

Commit

Permalink
test_install: add test_pip_args_with_wrong_constraint_fail
Browse files Browse the repository at this point in the history
  • Loading branch information
guysalt committed May 18, 2024
1 parent 43441c7 commit cc6a26f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,19 @@ def test_pip_args_with_constraint_relative_path(constraint_flag, pipx_temp_env,
assert subprocess_package_version_output != package_version


@pytest.mark.parametrize("constraint_flag", ["-c ", "--constraint ", "--constraint="])
def test_pip_args_with_wrong_constraint_fail(constraint_flag, pipx_ultra_temp_env, tmp_path, capsys):
constraint_file_name = "constraints.txt"
os.chdir(tmp_path)

assert run_pipx_cli(["install", f"--pip-args='{constraint_flag}{constraint_file_name}'", "pycowsay"])

assert (
f"ERROR: Could not open requirements file: [Errno 2] No such file or directory: '{constraint_file_name}'"
in capsys.readouterr().err
)


def test_install_suffix(pipx_temp_env, capsys):
name = "pbr"

Expand Down

0 comments on commit cc6a26f

Please sign in to comment.