aboutsummaryrefslogtreecommitdiffstats
path: root/conftest.py
blob: 0da92be9ad7cedf5b3ddd5d6920298ba924839d0 (plain)
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
import os


pytest_plugins = 'setuptools.tests.fixtures'


def pytest_addoption(parser):
    parser.addoption(
        "--package_name", action="append", default=[],
        help="list of package_name to pass to test functions",
    )


def pytest_configure():
    _issue_852_workaround()


def _issue_852_workaround():
    """
    Patch 'setuptools.__file__' with an absolute path
    for forward compatibility with Python 3.
    Workaround for https://github.com/pypa/setuptools/issues/852
    """
    setuptools = __import__('setuptools')
    setuptools.__file__ = os.path.abspath(setuptools.__file__)