Skip to content

Instantly share code, notes, and snippets.

@dragon0
Created December 1, 2017 20:58
Show Gist options
  • Save dragon0/5c520485d24ff4e605e8b250ca1e144e to your computer and use it in GitHub Desktop.
Save dragon0/5c520485d24ff4e605e8b250ca1e144e to your computer and use it in GitHub Desktop.
Python: execute doctests before running
def main():
pass
if __name__ == '__main__':
import doctest
failure_count, test_count = doctest.testmod()
if failure_count == 0:
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment