coverage.py: error out if tests are missing from ./tests or from coverage.txt
This commit is contained in:
parent
67fbe118f3
commit
348c582866
1 changed files with 16 additions and 2 deletions
18
coverage.py
18
coverage.py
|
@ -207,13 +207,27 @@ def main():
|
|||
# parse coverage.txt
|
||||
config_order, config_dict = parse_config("coverage.txt")
|
||||
|
||||
if set(os.listdir("tests")) - set(config_order):
|
||||
indirbutnotcovered = set(
|
||||
[d for d in os.listdir("tests") if not d.startswith(".")]
|
||||
) - set(config_order)
|
||||
if indirbutnotcovered:
|
||||
print(
|
||||
"test(s) missing from coverage.txt: %s"
|
||||
% (", ".join(sorted(set(os.listdir("tests")) - set(config_order)))),
|
||||
% (", ".join(sorted(indirbutnotcovered))),
|
||||
file=sys.stderr,
|
||||
)
|
||||
exit(1)
|
||||
coveredbutnotindir = set(config_order) - set(
|
||||
[d for d in os.listdir("tests") if not d.startswith(".")]
|
||||
)
|
||||
if coveredbutnotindir:
|
||||
print(
|
||||
"test(s) missing from ./tests: %s"
|
||||
% (", ".join(sorted(coveredbutnotindir))),
|
||||
file=sys.stderr,
|
||||
)
|
||||
|
||||
exit(1)
|
||||
|
||||
# produce the list of tests using the cartesian product of all allowed
|
||||
# dists, modes, variants and formats of a given test
|
||||
|
|
Loading…
Reference in a new issue