Skip to content

Commit

Permalink
test_install: add test_pip_args_with_constraint_relative_path
Browse files Browse the repository at this point in the history
  • Loading branch information
guysalt committed May 7, 2024
1 parent a591e9a commit 919d7e9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,27 @@ def test_pip_args_with_windows_path(pipx_temp_env, capsys):
assert r"D:\\TEST\\DIR" in captured.err


@pytest.mark.parametrize("constraint_flag", ["-c ", "--constraint ", "--constraint="])
def test_pip_args_with_constraint_relative_path(constraint_flag, pipx_temp_env, tmp_path, caplog):
constraint_file_name = "constraint.txt"
pycowsay_version = "0.0.0.1"

os.chdir(tmp_path)
current_directory = Path(".").expanduser().resolve()

temp_file = current_directory / constraint_file_name
temp_file.touch()
temp_file.write_text(f"pycowsay=={pycowsay_version}")

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

assert f"{constraint_flag}{temp_file}" in caplog.text

subprocess_pycowsay_version = subprocess.run(["pycowsay", "--version"], capture_output=True, text=True, check=False)
subprocess_pycowsay_version_output = subprocess_pycowsay_version.stdout.strip()
assert subprocess_pycowsay_version_output == pycowsay_version


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

Expand Down

0 comments on commit 919d7e9

Please sign in to comment.