File: conftest.py

package info (click to toggle)
black 25.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,180 kB
  • sloc: python: 113,389; makefile: 25
file content (28 lines) | stat: -rw-r--r-- 727 bytes parent folder | download | duplicates (2)
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
26
27
28
import pytest

pytest_plugins = ["tests.optional"]

PRINT_FULL_TREE: bool = False
PRINT_TREE_DIFF: bool = True


def pytest_addoption(parser: pytest.Parser) -> None:
    parser.addoption(
        "--print-full-tree",
        action="store_true",
        default=False,
        help="print full syntax trees on failed tests",
    )
    parser.addoption(
        "--print-tree-diff",
        action="store_true",
        default=True,
        help="print diff of syntax trees on failed tests",
    )


def pytest_configure(config: pytest.Config) -> None:
    global PRINT_FULL_TREE
    global PRINT_TREE_DIFF
    PRINT_FULL_TREE = config.getoption("--print-full-tree")
    PRINT_TREE_DIFF = config.getoption("--print-tree-diff")