Repository: kedro-org/kedro

Issue:
Bump up `pytest-cov` in project template and starters `pyproject.toml`
## Description
Following https://github.com/kedro-org/kedro/pull/4297, where we bumped `pytest-cov` from `3.0.0`, @DimedS pointed out that it is pinned at several places including within our starters and project template. I did a quick search of the codebase and it's tied to project creation tools so it might not be trivial to bump this up.


Discussion:
> The failures were due to the removal of multiprocessing support in `pytest-cov` in v 4.0.0. They recommend using `coverage`'s multiprocessing support by adding some config - https://pytest-cov.readthedocs.io/en/latest/subprocess-support.html#if-you-use-multiprocessing

And https://pypi.org/project/pytest-cov/3.0.0/ is from 2021
For the record, this is still there

https://github.com/kedro-org/kedro/blob/733b5267eafd3ee4899a82554b72bed6ded93193/kedro/templates/project/%7B%7B%20cookiecutter.repo_name%20%7D%7D/pyproject.toml#L34-L35



Patch:
diff --git a/docs/getting-started/install.md b/docs/getting-started/install.md
index 689f90b5f7..672d4e2d17 100644
--- a/docs/getting-started/install.md
+++ b/docs/getting-started/install.md
@@ -265,7 +265,7 @@ jupyterlab_server>=2.11.1
 jupyterlab~=3.0
 
 # Pytest + useful extensions
-pytest-cov~=3.0
+pytest-cov>=3,<7
 pytest-mock>=1.7.1, <2.0
 pytest~=7.2
 
diff --git a/kedro/templates/project/hooks/utils.py b/kedro/templates/project/hooks/utils.py
index 4212466979..65335288b3 100644
--- a/kedro/templates/project/hooks/utils.py
+++ b/kedro/templates/project/hooks/utils.py
@@ -10,7 +10,7 @@
 
 # Requirements and configurations for testing tools and coverage reporting
 test_requirements = (  # For requirements.txt
-    "pytest-cov~=3.0\npytest-mock>=1.7.1, <2.0\npytest~=7.2"
+    "pytest-cov>=3,<7\npytest-mock>=1.7.1, <2.0\npytest~=7.2"
 )
 test_pyproject_requirements = [  # For pyproject.toml
     "tool.pytest.ini_options",
diff --git a/kedro/templates/project/{{ cookiecutter.repo_name }}/pyproject.toml b/kedro/templates/project/{{ cookiecutter.repo_name }}/pyproject.toml
index d6465eea18..959ec2f27d 100644
--- a/kedro/templates/project/{{ cookiecutter.repo_name }}/pyproject.toml
+++ b/kedro/templates/project/{{ cookiecutter.repo_name }}/pyproject.toml
@@ -32,7 +32,7 @@ docs = [
     "myst-parser>=1.0,<2.1"
 ]
 dev = [
-    "pytest-cov~=3.0",
+    "pytest-cov>=3,<7",
     "pytest-mock>=1.7.1, <2.0",
     "pytest~=7.2",
     "ruff~=0.12.0"


Test patch:
diff --git a/features/steps/test_starter/{{ cookiecutter.repo_name }}/pyproject.toml b/features/steps/test_starter/{{ cookiecutter.repo_name }}/pyproject.toml
index ea11850fef..6422e3241f 100644
--- a/features/steps/test_starter/{{ cookiecutter.repo_name }}/pyproject.toml
+++ b/features/steps/test_starter/{{ cookiecutter.repo_name }}/pyproject.toml
@@ -31,7 +31,7 @@ docs = [
     "myst-parser>=1.0,<2.1"
 ]
 dev = [
-    "pytest-cov~=3.0",
+    "pytest-cov>=3,<7",
     "pytest-mock>=1.7.1, <2.0",
     "pytest~=7.2",
     "ruff~=0.1.8"
diff --git a/tests/framework/cli/test_starters.py b/tests/framework/cli/test_starters.py
index a42612f85f..4a3a03ce66 100644
--- a/tests/framework/cli/test_starters.py
+++ b/tests/framework/cli/test_starters.py
@@ -183,7 +183,7 @@ def _assert_requirements_ok(
         assert expected["coverage"] == pyproject_config["tool"]["coverage"]
 
         assert (
-            "pytest-cov~=3.0"
+            "pytest-cov>=3,<7"
             in pyproject_config["project"]["optional-dependencies"]["dev"]
         )
         assert (