Python?????????????
??????畏? ???????[ 2017/2/27 15:30:55 ] ????????Python ??????? ????
????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/
??????

???路???
??????????????????
2023/3/23 14:23:39???写?貌??????????
2023/3/22 16:17:39????????????????????些??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???路???????路
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11