mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
wikiparser: Exit with return value 1 on test failure
Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
53921be1b8
commit
085e3ffef3
@ -6,6 +6,7 @@ MoinMoin wiki parser
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
import urllib
|
import urllib
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@ -2060,7 +2061,9 @@ if __name__ == '__main__':
|
|||||||
if not arguments.skip_tests:
|
if not arguments.skip_tests:
|
||||||
# Make tests verbose if no input files given
|
# Make tests verbose if no input files given
|
||||||
verbose = not arguments.input
|
verbose = not arguments.input
|
||||||
doctest.testmod(verbose=verbose)
|
num_failed = doctest.testmod(verbose=verbose)[0]
|
||||||
|
if num_failed > 0:
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
for in_file in arguments.input:
|
for in_file in arguments.input:
|
||||||
with in_file.open() as wiki_file:
|
with in_file.open() as wiki_file:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user