Skip to content

Instantly share code, notes, and snippets.

@KentaYamada
Created May 21, 2016 13:41
Show Gist options
  • Save KentaYamada/d803b3264c634a25f4134a29b3076a29 to your computer and use it in GitHub Desktop.
Save KentaYamada/d803b3264c634a25f4134a29b3076a29 to your computer and use it in GitHub Desktop.
PythonでUnitTest
#coding -*- utf-8 -*-
import unittest
def add(x, y):
return x + y
class SampleUnitTest(unittest.TestCase):
#テストメソッドは先頭に必ず「test」と書く
def test_add(self):
result = add(1, 2)
self.assertEqual(3, result)
if __name__ == "__main__":
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment