Skip to content

Commit abc37b5

Browse files
committed
More minor internal coverage related settings and setup tweaks.
1 parent aec372b commit abc37b5

File tree

2 files changed

+38
-19
lines changed

2 files changed

+38
-19
lines changed

noxfile.py

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99
CHANGELOG = ROOT / "CHANGELOG.rst"
1010
DOCS = ROOT / "docs"
1111

12-
EXTRAS = ["", "[format]", "[format-nongpl]"]
12+
INSTALLABLE = [
13+
nox.param(value, id=name) for name, value in [
14+
("no-extras", ROOT),
15+
("format", f"{ROOT}[format]"),
16+
("format-nongpl", f"{ROOT}[format-nongpl]"),
17+
]
18+
]
1319

1420
NONGPL_LICENSES = [
1521
"Apache Software License",
@@ -21,7 +27,6 @@
2127
]
2228

2329

24-
2530
nox.options.sessions = []
2631

2732

@@ -35,36 +40,45 @@ def _session(fn):
3540

3641

3742
@session(python=["3.8", "3.9", "3.10", "3.11", "pypy3"])
38-
@nox.parametrize("extras", EXTRAS)
39-
def tests(session, extras):
43+
@nox.parametrize("installable", INSTALLABLE)
44+
def tests(session, installable):
4045

4146
env = dict(JSON_SCHEMA_TEST_SUITE=str(ROOT / "json"))
4247

43-
session.install("virtue", f"{ROOT}{extras}")
48+
session.install("virtue", installable)
49+
50+
if session.posargs and session.posargs[0] in {"coverage", "ghcoverage"}:
51+
ghcoverage = session.posargs.pop(0) == "ghcoverage"
4452

45-
ghcoverage = session.posargs == ["ghcoverage"]
46-
if session.posargs == ["coverage"] or ghcoverage:
4753
session.install("coverage[toml]")
48-
session.run("coverage", "run", "-m", "virtue", PACKAGE, env=env)
54+
session.run(
55+
"coverage",
56+
"run",
57+
*session.posargs,
58+
"-m",
59+
"virtue",
60+
PACKAGE,
61+
env=env,
62+
)
4963
session.run("coverage", "report")
64+
65+
if ghcoverage:
66+
session.run(
67+
"sh",
68+
ROOT / ".github/coverage.sh",
69+
f"{session.bin}/python",
70+
)
5071
else:
5172
session.run("virtue", *session.posargs, PACKAGE, env=env)
5273

53-
if ghcoverage:
54-
session.run(
55-
"sh",
56-
ROOT / ".github/coverage.sh",
57-
f"{session.bin}/python",
58-
)
59-
6074

6175
@session()
62-
@nox.parametrize("extras", EXTRAS)
63-
def audit(session, extras):
64-
session.install("pip-audit", f"{ROOT}{extras}")
76+
@nox.parametrize("installable", INSTALLABLE)
77+
def audit(session, installable):
78+
session.install("pip-audit", installable)
6579
session.run("python", "-m", "pip_audit")
6680

67-
if "nongpl" in extras:
81+
if "format-nongpl" in installable:
6882
session.install("pip-licenses")
6983
session.run(
7084
"python",

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ Release Information
100100
path = "CHANGELOG.rst"
101101
pattern = "(^v.+?)\nv"
102102

103+
[tool.coverage.html]
104+
show_contexts = true
105+
103106
[tool.coverage.run]
104107
branch = true
105108
source = ["jsonschema"]
@@ -115,6 +118,8 @@ omit = [
115118
"*/jsonschema/benchmarks/*",
116119
"*/jsonschema/tests/fuzz_validate.py",
117120
]
121+
show_missing = true
122+
skip_covered = true
118123

119124
[tool.doc8]
120125
ignore = [

0 commit comments

Comments
 (0)