From 28292d0f0a56fb54910df95f023dc186cf1a7ead Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Wed, 15 Jul 2020 11:35:58 -0500 Subject: [PATCH] Fix celerybeat cleanup error --- tests/unit/test_tasks.py | 11 ----------- warehouse/tasks.py | 2 -- 2 files changed, 13 deletions(-) diff --git a/tests/unit/test_tasks.py b/tests/unit/test_tasks.py index cbe28996d8ff..8824382da2af 100644 --- a/tests/unit/test_tasks.py +++ b/tests/unit/test_tasks.py @@ -38,17 +38,6 @@ def test_tls_redis_backend(): class TestWarehouseTask: - def test_header(self): - def header(request, thing): - pass - - task_type = type( - "Foo", (tasks.WarehouseTask,), {"__header__": staticmethod(header)} - ) - - obj = task_type() - obj.__header__(object()) - def test_call(self, monkeypatch): request = pretend.stub() registry = pretend.stub() diff --git a/warehouse/tasks.py b/warehouse/tasks.py index 9c581e9aa7ab..99c3e7d542c4 100644 --- a/warehouse/tasks.py +++ b/warehouse/tasks.py @@ -51,8 +51,6 @@ def _params_from_url(self, url, defaults): class WarehouseTask(celery.Task): def __new__(cls, *args, **kwargs): obj = super().__new__(cls, *args, **kwargs) - if getattr(obj, "__header__", None) is not None: - obj.__header__ = functools.partial(obj.__header__, object()) # We do this here instead of inside of __call__ so that exceptions # coming from the transaction manager get caught by the autoretry