Skip to content

Commit

Permalink
fix tests that failed on windows (#42)
Browse files Browse the repository at this point in the history
- skip linux only tests
- create checker for executable depending on OS
  • Loading branch information
trappitsch committed Apr 11, 2024
1 parent 94ac0ca commit d793fad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/cli/test_cli_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def test_installer_no_binary(rye_project):
assert "No release found." in result.output


@pytest.mark.skipif("sys.platform == 'win32'", reason="Not supported on Windows")
def test_installer_cli_linux(rye_project):
"""Create installer for linux CLI."""
installer_fname_exp = f"{rye_project.name}-v0.1.0-linux.sh"
Expand All @@ -61,6 +62,7 @@ def test_installer_cli_linux(rye_project):
assert installer_file.name in result.output


@pytest.mark.skipif("sys.platform == 'win32'", reason="Not supported on Windows")
def test_installer_gui_linux(rye_project):
"""Create installer for linux GUI."""
installer_fname_exp = f"{rye_project.name}-v0.1.0-linux.sh"
Expand Down
4 changes: 3 additions & 1 deletion tests/cli/test_cli_packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
import shutil
import sys
from pathlib import Path
import urllib.request

Expand Down Expand Up @@ -47,7 +48,8 @@ def test_package_project(rye_project, mocker, verbose):
# create fake binary
cargo_target = build_dir.joinpath("pyapp-v1.2.3/target/release")
cargo_target.mkdir(parents=True)
cargo_target.joinpath("pyapp").touch()
exename = "pyapp.exe" if sys.platform == "win32" else "pyapp"
cargo_target.joinpath(exename).touch()

runner = CliRunner()
result = runner.invoke(cli, cmd)
Expand Down

0 comments on commit d793fad

Please sign in to comment.