@power_session(envs=ENVS, logsdir=Folders.runlogs)
def tests(session: PowerSession, coverage, pkg_specs):
    'Run the test suite, including test reports generation and coverage reports. '
    rm_folder(Folders.site)
    rm_folder(Folders.reports_root)
    rm_file(Folders.coverage_intermediate_file)
    rm_file((Folders.root / 'coverage.xml'))
    session.install_reqs(setup=True, install=True, tests=True, extras=('all',), versions_dct=pkg_specs)
    conda_prefix = Path(session.bin)
    if (conda_prefix.name == 'bin'):
        conda_prefix = conda_prefix.parent
    session.run2('conda list', env={'CONDA_PREFIX': str(conda_prefix), 'CONDA_DEFAULT_ENV': session.get_session_id()})
    session.run2(('python ci_tools/check_python_version.py %s' % session.python))
    session.run2('pip install -e . --no-deps')
    session.run2(['python', '-c', ('"import os; os.chdir(\'./docs/\'); import %s"' % pkg_name)])
    if (not coverage):
        session.run2(('python -m pytest --cache-clear -v %s/tests/' % pkg_name))
    else:
        session.install_reqs(phase='coverage', phase_reqs=['coverage', 'pytest-html', 'requests'], versions_dct=pkg_specs)
        session.run2('coverage run --source {pkg_name} -m pytest --cache-clear --junitxml={test_xml} --html={test_html} -v {pkg_name}/tests/'.format(pkg_name=pkg_name, test_xml=Folders.test_xml, test_html=Folders.test_html))
        session.run2('coverage report')
        session.run2('coverage xml -o {covxml}'.format(covxml=Folders.coverage_xml))
        session.run2('coverage html -d {dst}'.format(dst=Folders.coverage_reports))
        rm_file(Folders.coverage_intermediate_file)
        nox_logger.info('Generating badge for tests coverage')
        session.run2(('genbadge tests -i %s -o %s -t 100' % (Folders.test_xml, Folders.test_badge)))
        session.run2(('genbadge coverage -i %s -o %s' % (Folders.coverage_xml, Folders.coverage_badge)))
Run the test suite, including test reports generation and coverage reports.
@power_session(envs=ENVS, logsdir=Folders.runlogs)
def tests(session: PowerSession, coverage, pkg_specs):
    ' '
    rm_folder(Folders.site)
    rm_folder(Folders.reports_root)
    rm_file(Folders.coverage_intermediate_file)
    rm_file((Folders.root / 'coverage.xml'))
    session.install_reqs(setup=True, install=True, tests=True, extras=('all',), versions_dct=pkg_specs)
    conda_prefix = Path(session.bin)
    if (conda_prefix.name == 'bin'):
        conda_prefix = conda_prefix.parent
    session.run2('conda list', env={'CONDA_PREFIX': str(conda_prefix), 'CONDA_DEFAULT_ENV': session.get_session_id()})
    session.run2(('python ci_tools/check_python_version.py %s' % session.python))
    session.run2('pip install -e . --no-deps')
    session.run2(['python', '-c', ('"import os; os.chdir(\'./docs/\'); import %s"' % pkg_name)])
    if (not coverage):
        session.run2(('python -m pytest --cache-clear -v %s/tests/' % pkg_name))
    else:
        session.install_reqs(phase='coverage', phase_reqs=['coverage', 'pytest-html', 'requests'], versions_dct=pkg_specs)
        session.run2('coverage run --source {pkg_name} -m pytest --cache-clear --junitxml={test_xml} --html={test_html} -v {pkg_name}/tests/'.format(pkg_name=pkg_name, test_xml=Folders.test_xml, test_html=Folders.test_html))
        session.run2('coverage report')
        session.run2('coverage xml -o {covxml}'.format(covxml=Folders.coverage_xml))
        session.run2('coverage html -d {dst}'.format(dst=Folders.coverage_reports))
        rm_file(Folders.coverage_intermediate_file)
        nox_logger.info('Generating badge for tests coverage')
        session.run2(('genbadge tests -i %s -o %s -t 100' % (Folders.test_xml, Folders.test_badge)))
        session.run2(('genbadge coverage -i %s -o %s' % (Folders.coverage_xml, Folders.coverage_badge)))