def test_unpatch_app(self): """ When unpatch_app is called on a patched app we unpatch the `task()` method """ # Assert it is patched before we start self.assertIsInstance(celery.Celery.task, wrapt.BoundFunctionWrapper) # Unpatch the app unpatch_app(celery.Celery) # Assert the method is not patched self.assertFalse(isinstance(celery.Celery.task, wrapt.BoundFunctionWrapper)) self.assertFalse(isinstance(celery.Celery.Task.__init__, wrapt.BoundFunctionWrapper))
def test_unpatch_app(self): """ When unpatch_app is called on a patched app we unpatch the `task()` method """ # Assert it is patched before we start self.assertIsInstance(celery.Celery.task, wrapt.BoundFunctionWrapper) # Unpatch the app unpatch_app(celery.Celery) # Assert the method is not patched self.assertFalse( isinstance(celery.Celery.task, wrapt.BoundFunctionWrapper)) self.assertFalse( isinstance(celery.Celery.Task.__init__, wrapt.BoundFunctionWrapper))
def tearDown(self): unpatch_app(celery.Celery)
def tearDown(self): unpatch_app(celery.Celery) unpatch_task(celery.Task)
def tearDown(self): unpatch_app(celery.Celery)