File pytest9.patch of Package python-django-celery-beat
From 78d62f41108a2c4a52f41f300ab91ea34962810e Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Thu, 1 Jan 2026 16:30:50 +0000
Subject: [PATCH] Allow pytest 9
https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
notes that applying a mark to a fixture function never had any effect.
It raises an exception during test collection with pytest 9.
---
requirements/test.txt | 2 +-
t/unit/test_schedulers.py | 3 ---
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/requirements/test.txt b/requirements/test.txt
index bd798673..8c3fd3f0 100644
--- a/requirements/test.txt
+++ b/requirements/test.txt
@@ -4,7 +4,7 @@ pytest-timeout
# Conditional dependencies
pytest>=6.2.5,<8.0; python_version < '3.9' # Python 3.8 only
-pytest>=6.2.5,<9.0; python_version >= '3.9' # Python 3.9+ only
+pytest>=6.2.5,<10.0; python_version >= '3.9' # Python 3.9+ only
pytest-django>=4.5.2,<4.6.0; python_version < '3.9' # Python 3.8 only
pytest-django>=4.5.2,<5.0; python_version >= '3.9' # Python 3.9+ only
backports.zoneinfo; python_version < '3.9' # Python 3.8 only
diff --git a/t/unit/test_schedulers.py b/t/unit/test_schedulers.py
index 1640f6b4..85c6694f 100644
--- a/t/unit/test_schedulers.py
+++ b/t/unit/test_schedulers.py
@@ -561,7 +561,6 @@ def test_task_with_expires(self):
class test_DatabaseSchedulerFromAppConf(SchedulerCase):
Scheduler = TrackingScheduler
- @pytest.mark.django_db
@pytest.fixture(autouse=True)
def setup_scheduler(self, app):
self.app = app
@@ -617,7 +616,6 @@ def test_periodic_task_model_schedule_type_change(self):
class test_DatabaseScheduler(SchedulerCase):
Scheduler = TrackingScheduler
- @pytest.mark.django_db
@pytest.fixture(autouse=True)
def setup_scheduler(self, app):
self.app = app
@@ -1588,7 +1586,6 @@ def test_track_changes(self):
@pytest.mark.django_db
class test_modeladmin_PeriodicTaskAdmin(SchedulerCase):
- @pytest.mark.django_db
@pytest.fixture(autouse=True)
def setup_scheduler(self, app):
self.app = app