Skip to content

Commit 0ff47b2

Browse files
author
Matthias Koeppe
committed
sage --fixdoctests: Exit with error on --update-known-test-failures without distributions
1 parent 2a58ae9 commit 0ff47b2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/bin/sage-fixdoctests

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,12 @@ if __name__ == "__main__":
560560

561561
args.ignore_bad_distributions = True
562562

563+
if not args.filename:
564+
if not args.update_known_test_failures:
565+
sys.exit("sage-fixdoctests: At least one filename is required when --update-known-test-failures is not used")
566+
if not args.distribution:
567+
sys.exit("sage-fixdoctests: At least one --distribution argument is required for --update-known-test-failures")
568+
563569
if args.distribution or args.venv or args.environment:
564570
args.keep_both = args.full_tracebacks = True
565571

@@ -569,9 +575,6 @@ if __name__ == "__main__":
569575
elif not args.distribution:
570576
args.distribution = ['']
571577

572-
if not args.filename and not args.update_known_test_failures:
573-
sys.exit("sage-fixdoctests: At least one filename is required when --update-known-test-failures is not used")
574-
575578
if len(args.filename) == 2 and not args.overwrite and not args.no_overwrite:
576579
print("sage-fixdoctests: When passing two filenames, the second one is taken as an output filename; "
577580
"this is deprecated. To pass two input filenames, use the option --overwrite.")

0 commit comments

Comments
 (0)