From c63ced835ee0ef22808e5ec15c68736af92e74d4 Mon Sep 17 00:00:00 2001 From: juftin Date: Sat, 13 Jul 2024 14:06:58 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20testing=20compatibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yaml | 10 +++++++++- pyproject.toml | 2 +- tests/test_integration_cli.py | 8 +++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4918958..94557f2 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -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, diff --git a/pyproject.toml b/pyproject.toml index 9ebd963..6178dc6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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}" diff --git a/tests/test_integration_cli.py b/tests/test_integration_cli.py index 0e6846d..a4ca770 100644 --- a/tests/test_integration_cli.py +++ b/tests/test_integration_cli.py @@ -27,11 +27,10 @@ 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: @@ -39,13 +38,12 @@ 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: