File: conftest.py

package info (click to toggle)
python-uhi 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 404 kB
  • sloc: python: 2,210; makefile: 12
file content (29 lines) | stat: -rw-r--r-- 817 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
23
24
25
26
27
28
29
from __future__ import annotations

from pathlib import Path

import pytest

DIR = Path(__file__).parent.resolve()
VALID_FILES = DIR.glob("resources/valid/*.json")
INVALID_FILES = DIR.glob("resources/invalid/*.json")


@pytest.fixture(scope="session")
def resources() -> Path:
    return DIR / "resources"


@pytest.fixture(params=VALID_FILES, ids=lambda p: p.name)
def valid(request: pytest.FixtureRequest) -> Path:
    return request.param  # type: ignore[no-any-return]


@pytest.fixture(params=INVALID_FILES, ids=lambda p: p.name)
def invalid(request: pytest.FixtureRequest) -> Path:
    return request.param  # type: ignore[no-any-return]


@pytest.fixture(params=[False, True], ids=["dense", "sparse"])
def sparse(request: pytest.FixtureRequest) -> bool:
    return request.param  # type: ignore[no-any-return]