disable connector in tests
This commit is contained in:
parent
2a6c13fc5c
commit
16e8c1e8e3
@ -2,7 +2,6 @@ import asyncio
|
||||
import logging
|
||||
import multiprocessing
|
||||
import queue
|
||||
import weakref
|
||||
from asyncio import Task
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
@ -50,7 +49,6 @@ class ConnectorManager:
|
||||
self._queue = multiprocessing.JoinableQueue(maxsize=settings.EXTERNAL_CONNECTORS_QUEUE_SIZE)
|
||||
self._worker = multiprocessing.Process(target=self.worker, args=(0, self._queue,), daemon=True)
|
||||
self._worker.start()
|
||||
self._finalizer = weakref.finalize(self, self.stop)
|
||||
|
||||
# Called by post save & post delete signals
|
||||
def __call__(self, instance: Any, **kwargs) -> None:
|
||||
@ -138,6 +136,9 @@ class ConnectorManager:
|
||||
|
||||
logging.info(f"terminating ConnectionManager worker {worker_id}")
|
||||
|
||||
asyncio.set_event_loop(None)
|
||||
loop.close()
|
||||
|
||||
@staticmethod
|
||||
def get_connected_for_config(config: ConnectorConfig) -> Optional[Connector]:
|
||||
match config.type:
|
||||
|
@ -1,3 +1,5 @@
|
||||
[pytest]
|
||||
DJANGO_SETTINGS_MODULE = recipes.settings
|
||||
python_files = tests.py test_*.py *_tests.py
|
||||
python_files = tests.py test_*.py *_tests.py
|
||||
env =
|
||||
DISABLE_EXTERNAL_CONNECTORS = 1
|
@ -36,6 +36,7 @@ django-scopes==2.0.0
|
||||
pytest==7.4.3
|
||||
pytest-asyncio==0.23.3
|
||||
pytest-django==4.6.0
|
||||
pytest-env==1.1.3
|
||||
django-treebeard==4.7
|
||||
django-cors-headers==4.2.0
|
||||
django-storages==1.14.2
|
||||
|
Loading…
Reference in New Issue
Block a user