diff --git a/pillar/tests/__init__.py b/pillar/tests/__init__.py index 329a9556..8090a867 100644 --- a/pillar/tests/__init__.py +++ b/pillar/tests/__init__.py @@ -8,6 +8,7 @@ import logging import os import sys import typing +import unittest.mock try: from urllib.parse import urlencode @@ -58,6 +59,16 @@ class PillarTestServer(pillar.PillarServer): logging.getLogger('werkzeug').setLevel(logging.DEBUG) logging.getLogger('eve').setLevel(logging.DEBUG) + def _config_celery(self): + """Disables Celery by entirely mocking it. + + Without this, actual Celery tasks will be created while the tests are running. + """ + + from celery import Celery + + self.celery = unittest.mock.MagicMock(Celery) + class AbstractPillarTest(TestMinimal): pillar_server_class = PillarTestServer