File: conftest.py

package info (click to toggle)
python-plaster 1.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 356 kB
  • sloc: python: 720; makefile: 161
file content (16 lines) | stat: -rw-r--r-- 487 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os.path
import sys

import pytest


@pytest.fixture(scope="session")
def fake_packages():
    # we'd like to keep this scope more focused but it's proven really
    # difficult to fully monkeypatch importlib.metadata and so for now we just
    # install the packages for the duration of the test suite
    test_dir = os.path.dirname(__file__)

    for name in ("app1", "app2"):
        info_dir = os.path.join(test_dir, "fake_packages", name)
        sys.path.insert(0, info_dir)