File: __init__.py

package info (click to toggle)
pynina 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 756 kB
  • sloc: python: 761; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 334 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
import json
import pathlib
from typing import Any


def load_fixture(filename: str) -> Any:
    """Load a fixtures from files."""

    script_dir = pathlib.Path(__file__).parent.resolve()
    fixture_path = script_dir / "fixtures" / filename

    with open(fixture_path, "r", encoding="utf-8") as file:
        return json.load(file)