Пример #1
0
def pytest_configure(config):
    global option
    option = config.option
    mode_A = config.getoption('runappdirect')
    mode_D = config.getoption('direct_apptest')
    if mode_D or not mode_A:
        config.addinivalue_line('python_files', APPLEVEL_FN)
    if not mode_A and not mode_D:  # 'own' tests
        from rpython.conftest import LeakFinder
        config.pluginmanager.register(LeakFinder())
Пример #2
0
def pytest_configure(config):
    if HOST_IS_PY3 and not config.getoption('direct_apptest'):
        raise ValueError(
            "On top of a Python 3 interpreter, the -D flag is mandatory")
    global option
    option = config.option
    mode_A = config.getoption('runappdirect')
    mode_D = config.getoption('direct_apptest')

    def py3k_skip(message):
        py.test.skip('[py3k] %s' % message)

    py.test.py3k_skip = py3k_skip
    if mode_D or not mode_A:
        config.addinivalue_line('python_files', APPLEVEL_FN)
    if not mode_A and not mode_D:  # 'own' tests
        from rpython.conftest import LeakFinder
        config.pluginmanager.register(LeakFinder())
    if mode_A:
        from pypy.tool.pytest.apptest import PythonInterpreter
        config.applevel = PythonInterpreter(config.option.python)
    else:
        config.applevel = None
Пример #3
0
def pytest_addhooks(pluginmanager):
    from rpython.conftest import LeakFinder
    pluginmanager.register(LeakFinder())
Пример #4
0
def pytest_addhooks(pluginmanager):
    if sys.version_info < (3, ):
        from rpython.conftest import LeakFinder
        pluginmanager.register(LeakFinder())