From 7a8696cd6d5611a7e2f929ca13f54e684126b6f2 Mon Sep 17 00:00:00 2001 From: Jie Han Date: Tue, 19 May 2020 03:44:27 +0800 Subject: [PATCH] change doctest line (#2007) * change doctest line import doctest is not relevant with algorithms. move it under main section. * from doctest import testmod Co-authored-by: Christian Clauss --- blockchain/chinese_remainder_theorem.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/blockchain/chinese_remainder_theorem.py b/blockchain/chinese_remainder_theorem.py index 8c3eb9b4b..2b1e66ebe 100644 --- a/blockchain/chinese_remainder_theorem.py +++ b/blockchain/chinese_remainder_theorem.py @@ -81,10 +81,9 @@ def chinese_remainder_theorem2(n1, r1, n2, r2): return (n % m + m) % m -# import testmod for testing our function -from doctest import testmod - if __name__ == "__main__": + from doctest import testmod + testmod(name="chinese_remainder_theorem", verbose=True) testmod(name="chinese_remainder_theorem2", verbose=True) testmod(name="invert_modulo", verbose=True)