????py.test????????
????????????py.test
????pip install pytest
?????????????д???????
????def func(x):
????return x + 1
????def test_answer():
????assert func(3) == 5
??????????????в??????
???????pytest???·????
????????????????????python.exe?????test.py ???????????磺

??????е?????????????

????2.4 Nose
????Nose???unittest??????????python???????????nose???????????????У?nose?????????????????????????xUnitcompatible????????????
????nose??????????https://nose.readthedocs.org/en/latest/
???????nose?????????python3?????????????????????
????2.5 tox
??????????????????????????????????????????????y??в????
????tox??????????http://testrun.org/tox/latest/
????2.6  Unittest2
??????unitest???????檔??API????????????????????????
????unittest2??????????https://pypi.python.org/pypi/unittest2
????????????
????pip install unittest2
??????????????unittest??unittest2???????л??????????д??????£?
????import unittest2 as unittest
????class MyTest(unittest.TestCase):
????...
????2.7 mock
????unittest.mock??????????python?????python3.3?汾???????????????? ????汾????????pip install mock ???а????
????mock??????????????????????????????????????????????????????????????????
????mock??????????http://www.voidspace.org.uk/python/mock/