From 7770fd580788b9f9c70c576142411257908b3098 Mon Sep 17 00:00:00 2001 From: Munim Munna <6266677+monim67@users.noreply.github.com> Date: Mon, 3 Oct 2022 09:25:59 +0600 Subject: [PATCH] Fix coverage reporting --- .github/workflows/build.yml | 2 ++ README.rst | 4 ++-- pyproject.toml | 9 ++++++++- tests/test_main.py | 6 ++---- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e2ba04..2e6b961 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,7 @@ jobs: - name: Install dependencies run: | + poetry env use ${{ matrix.python-version }} poetry install --no-root --only build --no-ansi --no-interaction poetry run pip install -c tests/pip-constraints.txt . @@ -62,6 +63,7 @@ jobs: - name: Install dependencies run: | + poetry env use ${{ matrix.python-version }} poetry install --no-root --only build --no-ansi --no-interaction poetry run pip install -c tests/pip-constraints.txt . diff --git a/README.rst b/README.rst index c17692f..0fc701e 100644 --- a/README.rst +++ b/README.rst @@ -98,8 +98,8 @@ This project is licensed under MIT License - see the :alt: Build Status :height: 20px -.. |coverage.io| image:: https://coveralls.io/repos/github/monim67/poetry-bumpversion/badge.svg?branch=master - :target: https://coveralls.io/github/monim67/poetry-bumpversion?branch=master +.. |coverage.io| image:: https://coveralls.io/repos/github/monim67/poetry-bumpversion/badge.svg + :target: https://coveralls.io/github/monim67/poetry-bumpversion :alt: Coverage Status :height: 20px diff --git a/pyproject.toml b/pyproject.toml index 1afa735..a5db404 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,7 +65,14 @@ add_select = "D401,D404" [tool.coverage.run] command_line = "-m pytest" -source = ["src"] +source = ["poetry_bumpversion"] +parallel = true + +[tool.coverage.paths] +source = [ + "src/poetry_bumpversion", + "**/site-packages/poetry_bumpversion", +] [tool.tox] legacy_tox_ini = """ diff --git a/tests/test_main.py b/tests/test_main.py index c71b311..7513da4 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -5,8 +5,8 @@ import subprocess from pathlib import Path -plugin_source_dir: Path = Path.cwd() / "src" testing_assets: Path = Path(__file__).parent / "assets" +plugin_pyproject_file: Path = Path.cwd() / "pyproject.toml" def copy_project(project_name: str, destination_dir: Path) -> Path: @@ -39,9 +39,7 @@ def execute_update_version_command( [ "coverage", "run", - "--source", - str(plugin_source_dir), - "--parallel-mode", + f"--rcfile={plugin_pyproject_file}", "-m", "poetry", "version",