File: conftest.py

package info (click to toggle)
python-aristaproto 1.2%2B20240521-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,484 kB
  • sloc: python: 5,915; java: 106; xml: 84; makefile: 6
file content (22 lines) | stat: -rw-r--r-- 397 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
import copy
import sys

import pytest


def pytest_addoption(parser):
    parser.addoption(
        "--repeat", type=int, default=1, help="repeat the operation multiple times"
    )


@pytest.fixture(scope="session")
def repeat(request):
    return request.config.getoption("repeat")


@pytest.fixture
def reset_sys_path():
    original = copy.deepcopy(sys.path)
    yield
    sys.path = original