Skip to content

Instantly share code, notes, and snippets.

@Aidan-Huang
Last active August 29, 2015 14:00
Show Gist options
  • Save Aidan-Huang/11314305 to your computer and use it in GitHub Desktop.
Save Aidan-Huang/11314305 to your computer and use it in GitHub Desktop.
unittest
#coding:utf-8
import unittest
def myadd(a,b):
return a+b
class test(unittest.TestCase):
def setUp(self):
print "start ",
def tearDown(self):
print " end"
def testS(self):
self.assertEqual(myadd(3,4),7)
def tests1(self):
self.assertEqual(myadd(3,4),6)
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment