Skip to content
Snippets Groups Projects
Commit b0437822 authored by Yoann Schneider's avatar Yoann Schneider :tennis: Committed by Bastien Abadie
Browse files

Speedup test by not loading a real client during tests

parent 6734da98
No related branches found
No related tags found
1 merge request!238Speedup test by not loading a real client during tests
Pipeline #79714 passed
......@@ -2,10 +2,13 @@
import os
import pytest
from arkindex_worker.worker.base import BaseWorker
from arkindex.mock import MockApiClient
@pytest.fixture(autouse=True)
def setup_environment(responses):
def setup_environment(responses, monkeypatch):
"""Setup needed environment variables"""
# Allow accessing remote API schemas
......@@ -20,3 +23,6 @@ def setup_environment(responses):
os.environ["ARKINDEX_API_SCHEMA_URL"] = schema_url
# Setup a fake worker run ID
os.environ["ARKINDEX_WORKER_RUN_ID"] = "1234-{{ cookiecutter.slug }}"
# Setup a mock api client instead of using a real one
monkeypatch.setattr(BaseWorker, "setup_api_client", lambda _: MockApiClient())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment