File: conftest.py

package info (click to toggle)
python-plaster-pastedeploy 0.5-6
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 316 kB
  • sloc: python: 639; makefile: 12
file content (14 lines) | stat: -rw-r--r-- 513 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import os.path
import pkg_resources
import pytest
import sys

@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 pkg_resources and so for now we just
    # install the packages for the duration of the test suite
    test_dir = os.path.dirname(__file__)
    info_dir = os.path.join(test_dir, 'fake_packages', 'FakeApp')
    sys.path.insert(0, info_dir)
    pkg_resources.working_set.add_entry(info_dir)