Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(tests): add logging output to console and deal with DEBUG mode #358

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tests/unit/test_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,25 @@
Stubs for mocking backends and exporters.
"""
import json
import logging
import os
import sys
import time
from types import ModuleType

from google.cloud import monitoring_v3

from slo_generator.constants import DEBUG
from slo_generator.utils import load_config, load_configs

LOGGER = logging.getLogger()
handler = logging.StreamHandler(sys.stdout)
LOGGER.addHandler(handler)
if DEBUG == 1:
LOGGER.setLevel(logging.DEBUG)
else:
LOGGER.setLevel(logging.INFO)

TEST_DIR = os.path.dirname(os.path.abspath(__file__))
SAMPLE_DIR = os.path.join(os.path.dirname(os.path.dirname(TEST_DIR)), "samples/")

Expand Down