From dd6f240d6d182c8aa67dc46381faeadc8fde44c6 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 21 Aug 2024 11:03:16 +0200 Subject: [PATCH] pre-commit autoupdate 2024-08-21 to fix PT001,PT023 (#789) --- t/unit/conftest.py | 4 ++-- t/unit/test_admin.py | 6 +++--- t/unit/test_models.py | 2 +- t/unit/test_schedulers.py | 20 ++++++++++---------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/t/unit/conftest.py b/t/unit/conftest.py index 836ed40f..e84c564f 100644 --- a/t/unit/conftest.py +++ b/t/unit/conftest.py @@ -22,7 +22,7 @@ def setup_default_app_trap(): set_default_app(Trap()) -@pytest.fixture() +@pytest.fixture def app(celery_app): return celery_app @@ -44,7 +44,7 @@ def add(x, y): request.instance.app = None -@pytest.fixture() +@pytest.fixture def patching(monkeypatch): def _patching(attr): monkeypatch.setattr(attr, MagicMock()) diff --git a/t/unit/test_admin.py b/t/unit/test_admin.py index 70d96cc9..37cf5af5 100644 --- a/t/unit/test_admin.py +++ b/t/unit/test_admin.py @@ -11,7 +11,7 @@ SolarSchedule) -@pytest.mark.django_db() +@pytest.mark.django_db class ActionsTests(TestCase): @classmethod @@ -76,7 +76,7 @@ def test_toggle_action_all_disabled(self): self.assertTrue(e3) -@pytest.mark.django_db() +@pytest.mark.django_db class ValidateUniqueTests(TestCase): def test_validate_unique_raises_if_schedule_not_set(self): @@ -115,7 +115,7 @@ def test_validate_unique_not_raises(self): PeriodicTask(clocked=ClockedSchedule(), one_off=True).validate_unique() -@pytest.mark.django_db() +@pytest.mark.django_db class DisableTasksTest(TestCase): @classmethod diff --git a/t/unit/test_models.py b/t/unit/test_models.py index df776963..9fffb909 100644 --- a/t/unit/test_models.py +++ b/t/unit/test_models.py @@ -160,7 +160,7 @@ def test_timezone_format(self): assert str(schedule.clocked_time) == str(schedule) -@pytest.mark.django_db() +@pytest.mark.django_db class OneToOneRelTestCase(TestCase): """ Make sure that when OneToOne relation Model changed, diff --git a/t/unit/test_schedulers.py b/t/unit/test_schedulers.py index dbafe666..d070bb45 100644 --- a/t/unit/test_schedulers.py +++ b/t/unit/test_schedulers.py @@ -58,7 +58,7 @@ def sync(self): schedulers.DatabaseScheduler.sync(self) -@pytest.mark.django_db() +@pytest.mark.django_db class SchedulerCase: def create_model_interval(self, schedule, **kwargs): @@ -113,7 +113,7 @@ def create_crontab_schedule(self): return CrontabSchedule.objects.create() -@pytest.mark.django_db() +@pytest.mark.django_db class test_ModelEntry(SchedulerCase): Entry = EntryTrackSave @@ -292,11 +292,11 @@ def test_one_off_task(self): assert delay == NEVER_CHECK_TIMEOUT -@pytest.mark.django_db() +@pytest.mark.django_db class test_DatabaseSchedulerFromAppConf(SchedulerCase): Scheduler = TrackingScheduler - @pytest.mark.django_db() + @pytest.mark.django_db @pytest.fixture(autouse=True) def setup_scheduler(self, app): self.app = app @@ -348,11 +348,11 @@ def test_periodic_task_model_schedule_type_change(self): assert self.m1.crontab is None -@pytest.mark.django_db() +@pytest.mark.django_db class test_DatabaseScheduler(SchedulerCase): Scheduler = TrackingScheduler - @pytest.mark.django_db() + @pytest.mark.django_db @pytest.fixture(autouse=True) def setup_scheduler(self, app): self.app = app @@ -645,7 +645,7 @@ def test_starttime_trigger(self, monkeypatch): assert s._heap[0][2].name == m1.name -@pytest.mark.django_db() +@pytest.mark.django_db class test_models(SchedulerCase): def test_IntervalSchedule_unicode(self): @@ -802,7 +802,7 @@ def test_ClockedSchedule_schedule(self): assert (nextcheck2 == NEVER_CHECK_TIMEOUT) and (isdue2 is True) -@pytest.mark.django_db() +@pytest.mark.django_db class test_model_PeriodicTasks(SchedulerCase): def test_track_changes(self): @@ -818,9 +818,9 @@ def test_track_changes(self): assert y > x -@pytest.mark.django_db() +@pytest.mark.django_db class test_modeladmin_PeriodicTaskAdmin(SchedulerCase): - @pytest.mark.django_db() + @pytest.mark.django_db @pytest.fixture(autouse=True) def setup_scheduler(self, app): self.app = app