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 <cclauss@me.com>
This commit is contained in:
Jie Han 2020-05-19 03:44:27 +08:00 committed by GitHub
parent f9e0dd94d6
commit 7a8696cd6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)