Skip to content
This repository was archived by the owner on Aug 19, 2022. It is now read-only.

Add pygments to tests session #97

Merged
merged 3 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Nox sessions."""
import contextlib
import shutil
import sys
import tempfile
from pathlib import Path
Expand Down Expand Up @@ -140,7 +141,7 @@ def mypy(session: Session) -> None:
def tests(session: Session) -> None:
"""Run the test suite."""
install_package(session)
install(session, "coverage[toml]", "pytest", "pytest-django")
install(session, "coverage[toml]", "pygments", "pytest", "pytest-django")
try:
session.run("coverage", "run", "--parallel", "-m", "pytest", *session.posargs)
finally:
Expand All @@ -163,3 +164,33 @@ def typeguard(session: Session) -> None:
install_package(session)
install(session, "pytest", "typeguard")
session.run("pytest", f"--typeguard-packages={package}", *session.posargs)


@nox.session(python=python_versions)
def xdoctest(session: Session) -> None:
"""Run examples with xdoctest."""
args = session.posargs or ["all"]
install_package(session)
install(session, "xdoctest")
session.run("python", "-m", "xdoctest", package, *args)


@nox.session(python="3.8")
def docs(session: Session) -> None:
"""Build the documentation."""
args = session.posargs or ["docs", "docs/_build"]

if session.interactive and not session.posargs:
args.insert(0, "--open-browser")

builddir = Path("docs", "_build")
if builddir.exists():
shutil.rmtree(builddir)

install_package(session)
install(session, "sphinx", "sphinx-autobuild")

if session.interactive:
session.run("sphinx-autobuild", *args)
else:
session.run("sphinx-build", *args)
Loading