Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan committed Apr 17, 2024
1 parent 050c545 commit ed741e6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,11 @@ def test_passed_python_and_force_flag_warning(pipx_temp_env, capsys):
), "Should not print warning if package does not exist yet"


def test_install_run_in_separate_directory(caplog, capsys, pipx_temp_env, monkeypatch, tmp_path):
monkeypatch.chdir(tmp_path)
f = Path("argparse.py")
f.touch()

install_packages(capsys, pipx_temp_env, caplog, ["pycowsay"], ["pycowsay"])
@pytest.mark.parametrize(
"python_version",
["3.0", "3.1"],
)
def test_install_fetch_missing_python_invalid(capsys, python_version):
assert run_pipx_cli(["install", "--python", python_version, "--fetch-missing-python", "pycowsay"])
captured = capsys.readouterr()
assert f"No executable for the provided Python version '{python_version}' found" in captured.out

0 comments on commit ed741e6

Please sign in to comment.