From 7349d2cebb9e5b8f96c54e34120e4ed143059020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Deuchnord?= Date: Sat, 27 Mar 2021 11:27:54 +0100 Subject: [PATCH] test: enhance return of the doctest script --- tests.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests.py b/tests.py index 482ab83..b7e17a7 100644 --- a/tests.py +++ b/tests.py @@ -1,6 +1,18 @@ +#!/usr/bin/env python3 + import doctest from kosmorrolib import * -for module in [events, ephemerides]: - doctest.testmod(module, verbose=True) + +if __name__ == '__main__': + failures = 0 + tests = 0 + + for module in [events, ephemerides]: + (f, t) = doctest.testmod(module) + failures += f + tests += t + + if failures == 0: + print("✔ All %d tests successfully passed." % tests)