diff --git a/pyproject.toml b/pyproject.toml
index 35bd816d3..81d351285 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -50,7 +50,7 @@ Documentation = "https://fastapi.tiangolo.com/"
 [project.optional-dependencies]
 test = [
     "pytest >=7.1.3,<8.0.0",
-    "pytest-cov >=2.12.0,<4.0.0",
+    "pytest-cov >=2.12.0,<5.0.0",
     "mypy ==0.982",
     "flake8 >=3.8.3,<6.0.0",
     "black == 22.8.0",