# -*- coding: utf-8 -*-
# :-
# SPDX-FileCopyrightText: © 2026 Franz Glasner
# SPDX-License-Identifier: MIT
r"""Automatic unittest context configuration.

Side-effects of import configure the test environment!

"""

import logging
import os
import sys


sys.path.insert(
    0,
    os.path.abspath(
        os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))))


TESTSNIPPETSDIR = os.path.join(
    os.path.abspath(os.path.dirname(__file__)),
    "snippets")


# Setup logging for the unittests: use a known fixed format w/o time
logging.captureWarnings(True)
logging.basicConfig(
    level=logging.DEBUG,
    style='%',
    format="[%(name)s][%(filename)s:%(lineno)d:%(funcName)s][%(levelname)s] %(message)s")        # noqa: E501 (line too long)
