From a4aaf27c5ef79014311d2f41172f8770bc44fa6e Mon Sep 17 00:00:00 2001 From: Pravin Kamble Date: Fri, 30 Jan 2026 19:53:31 +0530 Subject: [PATCH 1/4] Update pytest versions --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6613f1a665..7527f84c74 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,8 +49,8 @@ test = [ "importlib-metadata<5.0", # Pytest for running the tests. - "pytest>=7.0.1,<8", - "pytest-cov>=4.0.0,<5.0", + "pytest>=7.0.1,<10", + "pytest-cov>=4.0.0,<8.0", "pytest-django>=4.5.2,<5", # Remove when dropping support for Django<5.0 From 2c03b632480d2b74c91c383a2b491d2153fa0d70 Mon Sep 17 00:00:00 2001 From: Pravin Kamble Date: Fri, 30 Jan 2026 20:03:33 +0530 Subject: [PATCH 2/4] Ignore deprecation warnings from coreapi --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7527f84c74..e9ca8a1b4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -118,7 +118,10 @@ keep_full_version = true [tool.pytest.ini_options] addopts = "--tb=short --strict-markers -ra" testpaths = [ "tests" ] -filterwarnings = [ "ignore:CoreAPI compatibility is deprecated*:rest_framework.RemovedInDRF318Warning" ] +filterwarnings = [ + "ignore:CoreAPI compatibility is deprecated*:rest_framework.RemovedInDRF318Warning", + "ignore:'cgi' is deprecated:DeprecationWarning", +] [tool.coverage.run] # NOTE: source is ignored with pytest-cov (but uses the same). From a13a43dd12b25b0a5f3158fc82d28233b2b12009 Mon Sep 17 00:00:00 2001 From: Pravin Kamble Date: Fri, 30 Jan 2026 20:09:58 +0530 Subject: [PATCH 3/4] ignore coreapi deprecation warnings during test startup --- tox.ini | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index b13eabd1a2..5803f62e8d 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,11 @@ envlist = docs [testenv] -commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning runtests.py --coverage {posargs} +commands = + python -W error::DeprecationWarning \ + -W "ignore:'cgi' is deprecated:DeprecationWarning" \ + -W error::PendingDeprecationWarning \ + runtests.py --coverage {posargs} envdir = {toxworkdir}/venvs/{envname} setenv = PYTHONDONTWRITEBYTECODE=1 From 7401f96ceadb74a3eb1df2b83ada80c3e655f819 Mon Sep 17 00:00:00 2001 From: Pravin Kamble Date: Thu, 5 Feb 2026 12:21:09 +0530 Subject: [PATCH 4/4] Use pytest directly in tox and relax version pins --- pyproject.toml | 4 ++-- tox.ini | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e9ca8a1b4f..1915d94449 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,8 +49,8 @@ test = [ "importlib-metadata<5.0", # Pytest for running the tests. - "pytest>=7.0.1,<10", - "pytest-cov>=4.0.0,<8.0", + "pytest==9.*", + "pytest-cov==7.*", "pytest-django>=4.5.2,<5", # Remove when dropping support for Django<5.0 diff --git a/tox.ini b/tox.ini index 5803f62e8d..00e5bd57b8 100644 --- a/tox.ini +++ b/tox.ini @@ -10,11 +10,7 @@ envlist = docs [testenv] -commands = - python -W error::DeprecationWarning \ - -W "ignore:'cgi' is deprecated:DeprecationWarning" \ - -W error::PendingDeprecationWarning \ - runtests.py --coverage {posargs} +commands = pytest --cov --cov-report xml {posargs} envdir = {toxworkdir}/venvs/{envname} setenv = PYTHONDONTWRITEBYTECODE=1