@nox.session(python='3.8')
def coverage(session):
    coverage_env = {'COVERAGE_HOME': BASE, 'COVERAGE_FILE': f'{BASE}/.coverage', 'COVERAGE_RCFILE': f'{BASE}/.coveragerc'}
    _upgrade_basic(session)
    session.install('coverage', 'pytest')
    install_hydra(session, ['pip', 'install', '-e'])
    session.run('coverage', 'erase', env=coverage_env)
    for directory in ['plugins', 'examples/plugins']:
        selected_plugins = select_plugins(session=session, directory=directory)
        for plugin in selected_plugins:
            session.run('pip', 'install', '-e', os.path.join(directory, plugin.path), silent=SILENT)
        for plugin in selected_plugins:
            session.chdir(os.path.join(directory, plugin.path))
            cov_args = ['coverage', 'run', '--append', '-m']
            cov_args.extend(pytest_args())
            session.run(*cov_args, silent=SILENT, env=coverage_env)
            session.chdir(BASE)
    session.run('coverage', 'run', '--append', '-m', *pytest_args(), silent=SILENT, env=coverage_env)
    session.run('coverage', 'report', '--fail-under=80', env=coverage_env)
    session.run('coverage', 'erase', env=coverage_env)
@nox.session(python='3.8')
def coverage(session):
    coverage_env = {'COVERAGE_HOME': BASE, 'COVERAGE_FILE': f'{BASE}/.coverage', 'COVERAGE_RCFILE': f'{BASE}/.coveragerc'}
    _upgrade_basic(session)
    session.install('coverage', 'pytest')
    install_hydra(session, ['pip', 'install', '-e'])
    session.run('coverage', 'erase', env=coverage_env)
    for directory in ['plugins', 'examples/plugins']:
        selected_plugins = select_plugins(session=session, directory=directory)
        for plugin in selected_plugins:
            session.run('pip', 'install', '-e', os.path.join(directory, plugin.path), silent=SILENT)
        for plugin in selected_plugins:
            session.chdir(os.path.join(directory, plugin.path))
            cov_args = ['coverage', 'run', '--append', '-m']
            cov_args.extend(pytest_args())
            session.run(*cov_args, silent=SILENT, env=coverage_env)
            session.chdir(BASE)
    session.run('coverage', 'run', '--append', '-m', *pytest_args(), silent=SILENT, env=coverage_env)
    session.run('coverage', 'report', '--fail-under=80', env=coverage_env)
    session.run('coverage', 'erase', env=coverage_env)