1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
# Copyright 2020 Simon McVittie
#
# SPDX-License-Identifier: FSFAP
import unittest
try:
from tap.runner import TAPTestRunner
except ImportError:
TAPTestRunner = None # type: ignore
def main() -> None:
if TAPTestRunner is not None:
runner = TAPTestRunner()
runner.set_stream(True)
unittest.main(testRunner=runner)
else:
# You thought pycotap was a minimal TAP implementation?
print('TAP version 13')
print('1..1')
program = unittest.main(exit=False, verbosity=2)
if program.result.wasSuccessful():
print(
'ok 1 - %r (tap module not available)'
% program.result
)
else:
print(
'not ok 1 - %r (tap module not available)'
% program.result
)
raise SystemExit(1)
|