File: conftest.py

package info (click to toggle)
python-kajiki 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 700 kB
  • sloc: python: 4,098; makefile: 115
file content (15 lines) | stat: -rw-r--r-- 437 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import importlib
import pathlib
import sys

import pytest


@pytest.fixture(scope="session", autouse=True)
def add_test_data_module():
    here = pathlib.Path(__file__).parent
    data_package = here / "data" / "__init__.py"
    spec = importlib.util.spec_from_file_location("kajiki_test_data", str(data_package))
    module = importlib.util.module_from_spec(spec)
    sys.modules[spec.name] = module
    spec.loader.exec_module(module)