コード例 #1
0
def pytype(session: Session) -> None:
    """Run the static type checker using pytype."""
    args = session.posargs or ["--disable=import-error", *locations]
    session.install("pytype")
    session.run("pytype", *args)
コード例 #2
0
def cover(session) -> None:
    """Run tests and generate coverage reports in both terminal output and XML (for Codecov)"""
    session.run("pytest", *PYTEST_ARGS, *COVERAGE_ARGS)
コード例 #3
0
def mypy(session: Session) -> None:
    """Type-check using mypy."""
    pass
    args = session.posargs or locations
    session.install("mypy")
    session.run("mypy", *args)
コード例 #4
0
ファイル: noxfile.py プロジェクト: kiudee/cs-ranking
def black(session):
    """Run black code formatter."""
    args = session.posargs or locations
    session.install("black")
    session.run("black", *args)
コード例 #5
0
def xdoctest(session: Session) -> None:
    """Run examples with xdoctest."""
    args = session.posargs or ["all"]
    session.install(".")
    session.install("xdoctest[colors]")
    session.run("python", "-m", "xdoctest", package, *args)
コード例 #6
0
def coverage(session):
    """Run tests and generate coverage report"""
    cmd = 'pytest -n auto --cov --cov-report=term --cov-report=html'
    session.run(*cmd.split(' '))
コード例 #7
0
def lint(session):
    """Run linters and code formatters via pre-commit"""
    cmd = 'pre-commit run --all-files'
    session.run(*cmd.split(' '))
コード例 #8
0
def coverage(session):
    """Run tests and generate coverage report"""
    cmd_1 = f'pytest {UNIT_TESTS} -rs {XDIST_ARGS} {COVERAGE_ARGS}'
    cmd_2 = f'pytest {INTEGRATION_TESTS} -rs {XDIST_ARGS} {COVERAGE_ARGS} --cov-append'
    session.run(*cmd_1.split(' '))
    session.run(*cmd_2.split(' '))
コード例 #9
0
ファイル: noxfile.py プロジェクト: acjackman/note-clerk
def typeguard(session: Session) -> None:
    """Runtime type checking using Typeguard."""
    session.install(".")
    session.install("typeguard", "pygments", *TEST_REQUIREMENTS)
    session.run("pytest", f"--typeguard-packages={package}", *session.posargs)
コード例 #10
0
def test_main(session):
    session.poetry.installroot(distribution_format=SDIST)
    session.install('pytest')
    session.run(*args('pytest -v tests/main'))
コード例 #11
0
def docs(session: Session) -> None:
    """Build the documentation."""
    session.install(".")
    session.install("sphinx", "sphinx_autodoc_typehints")
    session.run("sphinx-build", "docs", "docs/_build")
コード例 #12
0
def test_geo(session):
    session.poetry.installroot(distribution_format=SDIST)
    session.install('csv-reconcile-geo')
    session.install('pytest')
    session.run(*args('pytest -v tests/plugins/geo'))
コード例 #13
0
def docs(session):
    """Build Sphinx documentation"""
    session.run("sphinx-build", "docs", "docs/_build/html", "-j", "auto")
コード例 #14
0
def test(session) -> None:
    session.run("pytest", *PYTEST_ARGS)
コード例 #15
0
def coverage(session: Session) -> None:
    """Upload coverage data."""
    session.install("coverage[toml]", "codecov")
    session.run("coverage", "xml", "--fail-under=0")
    session.run("codecov", *session.posargs)
コード例 #16
0
ファイル: noxfile.py プロジェクト: lhayhurst/gedemo
def tests(session):
    session.install("pytest", ".")
    session.run("pytest", *session.posargs)
コード例 #17
0
def test(session):
    """Run tests for a specific python version"""
    test_paths = session.posargs or ['test']
    session.install('.', 'pytest', 'pytest-sugar', 'pytest-xdist',
                    'requests-mock')
    session.run('pytest', '-n', 'auto', *test_paths)
コード例 #18
0
def tests(session: Session) -> None:
    session.install(".")
    session.install("pytest", "coverage[toml]", "hypothesis", "pytest-cov")
    session.run("poetry", "install", external=True)
    session.run("pytest", "--cov")
コード例 #19
0
def docs(session):
    """Build Sphinx documentation"""
    cmd = 'sphinx-build docs docs/_build/html -j auto'
    session.run(*cmd.split(' '))
コード例 #20
0
def black(session: Session) -> None:
    args = session.posargs or locations
    session.install("black", "blackdoc")
    session.run("black", *args)
    session.run("blackdoc", *args)
コード例 #21
0
ファイル: noxfile.py プロジェクト: paw-lu/jinja-loader-bug
def tests(session: Session) -> None:
    session.install(".")
    session.install("pytest")
    session.run("pytest")
コード例 #22
0
ファイル: noxfile.py プロジェクト: fossabot/asyncpixel
def typeguard(session: Session) -> None:
    """Runtime type checking using Typeguard."""
    session.install(".")
    session.install("pytest", "typeguard", "pygments", "aioresponses",
                    "pytest-asyncio")
    session.run("pytest", f"--typeguard-packages={package}", *session.posargs)
コード例 #23
0
def safety(session: Session) -> None:
    """Scan dependencies for insecure packages."""
    requirements = session.poetry.export_requirements()
    session.install("safety")
    session.run("safety", "check", "--full-report", f"--file={requirements}")
コード例 #24
0
def lint(session):
    session.run("black", ".", external=True)
    session.run("flake8", "./ioccheck", "./test", external=True)
    session.run("bandit", "-r", "./ioccheck", external=True)
    session.run("mypy", "--warn-unreachable", "./ioccheck", external=True)
    session.run("pylint", "./ioccheck", external=True)
    session.run("isort", ".", external=True)
コード例 #25
0
def typeguard(session: Session) -> None:
    """Runtime type checking using Typeguard."""
    session.install(".")
    session.install("pytest", "typeguard", "pygments", "requests-mock")
    session.run("pytest", f"--typeguard-packages={package}", *session.posargs)
コード例 #26
0
def lint(session) -> None:
    session.run("pre-commit", "run", "--all-files")