Last active
May 18, 2022 05:01
-
-
Save Pinacolada64/f6be901af1453da1296fd758c995bfb1 to your computer and use it in GitHub Desktop.
doctest test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import doctest | |
import logging | |
def add_two_numbers(a, b): | |
""" | |
Add two numbers, a and b, together. Return the total. | |
:param a: first number to add | |
:param b: second number to add | |
:return: total (a+b) | |
>>> add_two_numbers(4, 5) | |
9 | |
>>> add_two_numbers(-4, 13) | |
9 | |
""" | |
# print(a+b) | |
return a+b | |
if __name__ == '__main__': | |
logging.basicConfig(level=logging.DEBUG, format='[%(levelname)s] | %(message)s') | |
doctest.testmod(verbose=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment