coverage.py: add --skip option

This commit is contained in:
Johannes Schauer Marin Rodrigues 2022-11-08 12:43:10 +01:00
parent bf33a614c3
commit d2238c891b
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -172,6 +172,9 @@ def main():
metavar="format", metavar="format",
help=f"only run tests with this format (Default = {default_format})", help=f"only run tests with this format (Default = {default_format})",
) )
parser.add_argument(
"--skip", metavar="test", action="append", help="skip this test"
)
args = parser.parse_args() args = parser.parse_args()
# copy over files from git or as distributed # copy over files from git or as distributed
@ -310,6 +313,9 @@ def main():
print(f"skipped because of {reason}", file=sys.stderr) print(f"skipped because of {reason}", file=sys.stderr)
continue continue
print(separator, file=sys.stderr) print(separator, file=sys.stderr)
if args.skip and name in args.skip:
print(f"skipping because of --skip={name}", file=sys.stderr)
continue
if args.dist and args.dist != dist: if args.dist and args.dist != dist:
print(f"skipping because of --dist={args.dist}", file=sys.stderr) print(f"skipping because of --dist={args.dist}", file=sys.stderr)
continue continue