Skip to content

Commit

Permalink
pre-commit autoupdate 2024-08-21 to fix PT001,PT023 (#789)
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored Aug 21, 2024
1 parent a5bd11d commit dd6f240
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions t/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def setup_default_app_trap():
set_default_app(Trap())


@pytest.fixture()
@pytest.fixture
def app(celery_app):
return celery_app

Expand All @@ -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())
Expand Down
6 changes: 3 additions & 3 deletions t/unit/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
SolarSchedule)


@pytest.mark.django_db()
@pytest.mark.django_db
class ActionsTests(TestCase):

@classmethod
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion t/unit/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
20 changes: 10 additions & 10 deletions t/unit/test_schedulers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand All @@ -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
Expand Down

0 comments on commit dd6f240

Please sign in to comment.