File: conftest.py

package info (click to toggle)
tox 4.25.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,032 kB
  • sloc: python: 18,531; sh: 22; makefile: 14
file content (14 lines) | stat: -rw-r--r-- 400 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from __future__ import annotations

from pathlib import Path
from typing import Any, Sequence

HERE = Path(__file__).parent


def pytest_collection_modifyitems(items: Sequence[Any]) -> None:
    """automatically apply plugin test to all the test in this suite"""
    root = str(HERE)
    for item in items:
        if item.module.__file__.startswith(root):
            item.add_marker("plugin_test")