def test_plugins_in_directory(session, install_cmd, directory: str, test_hydra_core: bool):
    _upgrade_basic(session)
    session.install('pytest')
    install_hydra(session, install_cmd)
    selected_plugin = select_plugins(session=session, directory=directory)
    for plugin in selected_plugin:
        cmd = (list(install_cmd) + [os.path.join(directory, plugin.path)])
        session.run(*cmd, silent=SILENT)
        if (not SILENT):
            session.run('pipdeptree', '-p', plugin.name)
    session.run('python', '-c', 'from hydra import main', silent=SILENT)
    for plugin in selected_plugin:
        session.run('python', '-c', f'import {plugin.module}')
    if test_hydra_core:
        if (not SKIP_CORE_TESTS):
            run_pytest(session, 'tests', '--ignore=tests/test_completion.py')
        else:
            session.log('Skipping Hydra core tests')
    for plugin in selected_plugin:
        session.chdir(os.path.join(BASE, directory, plugin.path))
        run_pytest(session)
def test_plugins_in_directory(session, install_cmd, directory: str, test_hydra_core: bool):
    _upgrade_basic(session)
    session.install('pytest')
    install_hydra(session, install_cmd)
    selected_plugin = select_plugins(session=session, directory=directory)
    for plugin in selected_plugin:
        cmd = (list(install_cmd) + [os.path.join(directory, plugin.path)])
        session.run(*cmd, silent=SILENT)
        if (not SILENT):
            session.run('pipdeptree', '-p', plugin.name)
    session.run('python', '-c', 'from hydra import main', silent=SILENT)
    for plugin in selected_plugin:
        session.run('python', '-c', f'import {plugin.module}')
    if test_hydra_core:
        if (not SKIP_CORE_TESTS):
            run_pytest(session, 'tests', '--ignore=tests/test_completion.py')
        else:
            session.log('Skipping Hydra core tests')
    for plugin in selected_plugin:
        session.chdir(os.path.join(BASE, directory, plugin.path))
        run_pytest(session)