Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Commit ffc0557

Browse files
author
staticdev
committed
#7 added typeguard
1 parent 58ed53a commit ffc0557

3 files changed

Lines changed: 71 additions & 45 deletions

File tree

noxfile.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import nox
66
from nox.sessions import Session
77

8-
8+
package = "toml_validator"
99
nox.options.sessions = "lint", "safety", "mypy", "tests"
1010
locations = "src", "tests", "noxfile.py"
1111

@@ -94,6 +94,15 @@ def tests(session: Session) -> None:
9494
session.run("pytest", *args)
9595

9696

97+
@nox.session(python=["3.8", "3.7"])
98+
def typeguard(session: Session) -> None:
99+
"""Runtime type checking using Typeguard."""
100+
args = session.posargs or ["-m", "not e2e"]
101+
session.run("poetry", "install", "--no-dev", external=True)
102+
install_with_constraints(session, "pytest", "pytest-mock", "typeguard")
103+
session.run("pytest", f"--typeguard-packages={package}", *args)
104+
105+
97106
@nox.session(python="3.8")
98107
def coverage(session: Session) -> None:
99108
"""Upload coverage data."""

poetry.lock

Lines changed: 60 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ safety = "^1.8.5"
2828
mypy = "^0.770"
2929
codecov = "^2.0.22"
3030
pytest-mock = "^3.0.0"
31+
typeguard = "^2.7.1"
3132

3233
[tool.poetry.scripts]
3334
toml-validator = "toml_validator.console:main"

0 commit comments

Comments
 (0)