File: conftest.py

package info (click to toggle)
grml2usb 0.20.10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 680 kB
  • sloc: python: 1,500; sh: 330; asm: 225; makefile: 70
file content (13 lines) | stat: -rw-r--r-- 316 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
import os

import pytest


def pytest_configure(config):
    config.addinivalue_line("markers", "require_root: mark test to run only as root")


def pytest_runtest_setup(item):
    if "require_root" in {mark.name for mark in item.iter_markers()}:
        if os.getuid() != 0:
            pytest.skip("must be root")