Diff of /tests/conftest.py [000000] .. [fde104]

Switch to unified view

a b/tests/conftest.py
1
from pathlib import Path
2
3
import pytest
4
5
6
@pytest.fixture()
7
def samples_path():
8
    """Return the path to the samples."""
9
    return Path(__file__).parent / "samples"
10
11
12
def pytest_generate_tests(metafunc):
13
    """Generate test scenarios.
14
15
    See
16
    https://docs.pytest.org/en/7.1.x/example/parametrize.html#a-quick-port-of-testscenarios
17
    """
18
    id_list = []
19
    arg_values = []
20
    if metafunc.cls is None:
21
        return
22
    for scenario in metafunc.cls.scenarios:
23
        id_list.append(scenario[0])
24
        items = scenario[1].items()
25
        arg_names = [x[0] for x in items]
26
        arg_values.append([x[1] for x in items])
27
    metafunc.parametrize(arg_names, arg_values, ids=id_list, scope="class")