File: toxfile.py

package info (click to toggle)
python-azure 20250603%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 851,724 kB
  • sloc: python: 7,362,925; ansic: 804; javascript: 287; makefile: 195; sh: 145; xml: 109
file content (25 lines) | stat: -rw-r--r-- 768 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import os
from logging import getLogger
from pathlib import Path

from tox import plugin
from tox.config.sets import CoreConfigSet
from tox.session.state import State

logger = getLogger(__file__)

NAME = "azure-sdk-for-python tox plugin"

@plugin.impl
def tox_add_core_config(core_conf: CoreConfigSet, state: State):
    core_conf.add_constant(
        "repository_root",
        "The root of this git repository",
        next(p for p in Path(core_conf["config_file_path"]).resolve().parents if (p / ".git").exists()),
    )

    core_conf.add_constant(
        "pytest_log_level",
        "The log level to use for pytest, supplied as environment or queue time variable PYTEST_LOG_LEVEL",
        os.getenv("PYTEST_LOG_LEVEL", "51")  # Defaults to no logging
    )