Skip to content

Instantly share code, notes, and snippets.

@Pinacolada64
Last active May 18, 2022 05:01
Show Gist options
  • Save Pinacolada64/f6be901af1453da1296fd758c995bfb1 to your computer and use it in GitHub Desktop.
Save Pinacolada64/f6be901af1453da1296fd758c995bfb1 to your computer and use it in GitHub Desktop.
doctest test
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