Pythonã®æ¨æºã©ã¤ãã©ãªã«å«ã¾ããunittest.mockã¢ã¸ã¥ã¼ã«ã®ä½¿ãæ¹ã¡ã¢ãpatchã®ã¿ã 試ãããã¼ã¸ã§ã³ã¯ãPython 3.5 ãã¹ã対象 main.py import subprocess def say(message): """echoã³ãã³ãã§messageãå®è¡ãã """ return subprocess.call(['echo', message]) def say_hello(somebody): """ãHello, {somebody}!ãã¨ç»é¢ã«è¡¨ç¤ºããé¢æ° """ message = "Hello, {}!".format(somebody) return say(message) if __name__ == '__main__': say_hello("tokibito") å®è¡ããã¨æ¬¡ã®ããã«ãªãã $ python main.py He
{{#tags}}- {{label}}
{{/tags}}