Skip to content

Commit dd6f240

Browse files
authored
pre-commit autoupdate 2024-08-21 to fix PT001,PT023 (celery#789)
1 parent a5bd11d commit dd6f240

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

t/unit/conftest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def setup_default_app_trap():
2222
set_default_app(Trap())
2323

2424

25-
@pytest.fixture()
25+
@pytest.fixture
2626
def app(celery_app):
2727
return celery_app
2828

@@ -44,7 +44,7 @@ def add(x, y):
4444
request.instance.app = None
4545

4646

47-
@pytest.fixture()
47+
@pytest.fixture
4848
def patching(monkeypatch):
4949
def _patching(attr):
5050
monkeypatch.setattr(attr, MagicMock())

t/unit/test_admin.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
SolarSchedule)
1212

1313

14-
@pytest.mark.django_db()
14+
@pytest.mark.django_db
1515
class ActionsTests(TestCase):
1616

1717
@classmethod
@@ -76,7 +76,7 @@ def test_toggle_action_all_disabled(self):
7676
self.assertTrue(e3)
7777

7878

79-
@pytest.mark.django_db()
79+
@pytest.mark.django_db
8080
class ValidateUniqueTests(TestCase):
8181

8282
def test_validate_unique_raises_if_schedule_not_set(self):
@@ -115,7 +115,7 @@ def test_validate_unique_not_raises(self):
115115
PeriodicTask(clocked=ClockedSchedule(), one_off=True).validate_unique()
116116

117117

118-
@pytest.mark.django_db()
118+
@pytest.mark.django_db
119119
class DisableTasksTest(TestCase):
120120

121121
@classmethod

t/unit/test_models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def test_timezone_format(self):
160160
assert str(schedule.clocked_time) == str(schedule)
161161

162162

163-
@pytest.mark.django_db()
163+
@pytest.mark.django_db
164164
class OneToOneRelTestCase(TestCase):
165165
"""
166166
Make sure that when OneToOne relation Model changed,

t/unit/test_schedulers.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def sync(self):
5858
schedulers.DatabaseScheduler.sync(self)
5959

6060

61-
@pytest.mark.django_db()
61+
@pytest.mark.django_db
6262
class SchedulerCase:
6363

6464
def create_model_interval(self, schedule, **kwargs):
@@ -113,7 +113,7 @@ def create_crontab_schedule(self):
113113
return CrontabSchedule.objects.create()
114114

115115

116-
@pytest.mark.django_db()
116+
@pytest.mark.django_db
117117
class test_ModelEntry(SchedulerCase):
118118
Entry = EntryTrackSave
119119

@@ -292,11 +292,11 @@ def test_one_off_task(self):
292292
assert delay == NEVER_CHECK_TIMEOUT
293293

294294

295-
@pytest.mark.django_db()
295+
@pytest.mark.django_db
296296
class test_DatabaseSchedulerFromAppConf(SchedulerCase):
297297
Scheduler = TrackingScheduler
298298

299-
@pytest.mark.django_db()
299+
@pytest.mark.django_db
300300
@pytest.fixture(autouse=True)
301301
def setup_scheduler(self, app):
302302
self.app = app
@@ -348,11 +348,11 @@ def test_periodic_task_model_schedule_type_change(self):
348348
assert self.m1.crontab is None
349349

350350

351-
@pytest.mark.django_db()
351+
@pytest.mark.django_db
352352
class test_DatabaseScheduler(SchedulerCase):
353353
Scheduler = TrackingScheduler
354354

355-
@pytest.mark.django_db()
355+
@pytest.mark.django_db
356356
@pytest.fixture(autouse=True)
357357
def setup_scheduler(self, app):
358358
self.app = app
@@ -645,7 +645,7 @@ def test_starttime_trigger(self, monkeypatch):
645645
assert s._heap[0][2].name == m1.name
646646

647647

648-
@pytest.mark.django_db()
648+
@pytest.mark.django_db
649649
class test_models(SchedulerCase):
650650

651651
def test_IntervalSchedule_unicode(self):
@@ -802,7 +802,7 @@ def test_ClockedSchedule_schedule(self):
802802
assert (nextcheck2 == NEVER_CHECK_TIMEOUT) and (isdue2 is True)
803803

804804

805-
@pytest.mark.django_db()
805+
@pytest.mark.django_db
806806
class test_model_PeriodicTasks(SchedulerCase):
807807

808808
def test_track_changes(self):
@@ -818,9 +818,9 @@ def test_track_changes(self):
818818
assert y > x
819819

820820

821-
@pytest.mark.django_db()
821+
@pytest.mark.django_db
822822
class test_modeladmin_PeriodicTaskAdmin(SchedulerCase):
823-
@pytest.mark.django_db()
823+
@pytest.mark.django_db
824824
@pytest.fixture(autouse=True)
825825
def setup_scheduler(self, app):
826826
self.app = app

0 commit comments

Comments
 (0)