Skip to content

Commit 03d147e

Browse files
committed
Be more selective in directories tested for coverage
By changing `include` and `omit` values for `tool.coverage.run`, we can limit the files that pytest-cov scans to look foir tests and thereby gain a slight speedup. (I'm seeing 5% faster times on a Linux system when running with `-n 32`.)
1 parent 9d3bc76 commit 03d147e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ extend-exclude = ".*_pb2[.]py[i]?"
1212

1313
[tool.coverage.run]
1414
include = [
15-
# Omit files outside the current working directory.
15+
# Include only the directories that have pytest tests in them.
1616
# Note: this means coverage must be run from the cirq repo root.
1717
# Failure to do so will result in false positives.
18-
"./*",
18+
"./cirq-*",
19+
"./dev_tools/*",
20+
"./examples/*",
1921
]
20-
omit = ["benchmarks/*"]
2122
patch = ["subprocess"]
2223
# Speed up pytest-cov on Python 3.12+ by enabling sys.monitoring if possible.
2324
core = "sysmon"

0 commit comments

Comments
 (0)