Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
satyaog committed Mar 27, 2024
1 parent bb105ab commit a766ee8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import json
import os
import shutil
import sys
import tempfile
import zoneinfo
from pathlib import Path
from unittest.mock import MagicMock, mock_open, patch
from unittest.mock import MagicMock, mock_open

from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter
from opentelemetry.trace import get_tracer_provider, set_tracer_provider
from opentelemetry.trace import set_tracer_provider

_tracer_provider = TracerProvider()
_exporter = InMemorySpanExporter()
Expand All @@ -24,7 +24,6 @@
from sarc.config import (
ClusterConfig,
Config,
MongoConfig,
ScraperConfig,
config,
parse_config,
Expand Down Expand Up @@ -73,6 +72,14 @@ def disabled_cache():
yield


# Make sure the cache dir is empty before running the tests
@pytest.fixture(scope="session", autouse=True)
def clean_up_test_cache_before_run(standard_config_object):
if standard_config_object.cache.exists():
shutil.rmtree(str(standard_config_object.cache))
yield


@pytest.fixture
def tzlocal_is_mtl(monkeypatch):
monkeypatch.setattr("sarc.config.TZLOCAL", zoneinfo.ZoneInfo("America/Montreal"))
Expand Down

0 comments on commit a766ee8

Please sign in to comment.