Skip to content

Commit

Permalink
🧪 testing compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
juftin committed Jul 13, 2024
1 parent a68b0f1 commit c63ced8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,18 @@ jobs:
hatch_version: "1.11.1",
os: ubuntu-latest,
}
- {
name: Hatch-1.12.x,
python: "3.11",
command: "versions:cov",
matrix: "+version=1.12.x",
hatch_version: "1.12.0",
os: ubuntu-latest,
}
- {
name: Hatch-Windows,
python: "3.11",
command: "matrix:cov tests/ -vv",
command: "matrix:cov",
matrix: "+py=3.11",
hatch_version: "1.0",
os: windows-latest,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ dependencies = [

[tool.hatch.envs.test.scripts]
cov = [
"pytest --cov --cov-config=pyproject.toml --cov-report=html --cov-report=term-missing {args: -n auto tests/ -vv}"
"pytest --cov --cov-config=pyproject.toml --cov-report=xml --cov-report=term-missing {args: -n auto tests/ -vv}"
]
test = [
"pytest {args: -n auto tests/ -vv}"
Expand Down
8 changes: 3 additions & 5 deletions tests/test_integration_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,23 @@ def test_invoke_environment_creates_env(
environment = pip_compile.update_environment_installer(
environment=environment, installer=installer
)
_, venv_path = pip_compile.get_virtualenv(environment=environment)
assert not venv_path.exists()
assert not pip_compile.virtualenv_exists(environment=environment)
result = pip_compile.invoke_environment(environment=environment)
assert result.exit_code == 0
assert venv_path.exists()
assert pip_compile.virtualenv_exists(environment=environment)


def test_missing_lockfile_created(pip_compile: PipCompileFixture) -> None:
"""
Running the CLI without a lockfile creates one
"""
environment = pip_compile.default_environment
_, venv_path = pip_compile.get_virtualenv(environment=environment)
environment.piptools_lock_file.unlink()
assert not environment.piptools_lock_file.exists()
result = pip_compile.invoke_environment(environment=environment)
assert result.exit_code == 0
assert environment.piptools_lock_file.exists()
assert venv_path.exists()
assert pip_compile.virtualenv_exists(environment=environment)


def test_constraint_env_created(pip_compile: PipCompileFixture) -> None:
Expand Down

0 comments on commit c63ced8

Please sign in to comment.