Created
August 11, 2016 08:38
-
-
Save KentaYamada/21f595bb03aeb8592984dd1d2f4533e2 to your computer and use it in GitHub Desktop.
今さらdoctest使ってみた
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
# -*-coding: utf-8 -*- | |
def hoge(n): | |
return n * 2 | |
def piyo(): | |
return "Hello." | |
def test_hoge(): | |
""" | |
Hoge関数のテスト | |
>>> hoge(2) | |
4 | |
piyo関数のテスト | |
>>> piyo() | |
'Hello.' | |
""" | |
if __name__ == "__main__": | |
import doctest | |
doctest.testmod() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment