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 15, 2024
1 parent 2831603 commit d77d362
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 @@ -294,6 +294,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 = "constraint.txt"
os.chdir(tmp_path)

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

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 d77d362

Please sign in to comment.