假设我写了一个class
类似于dict
. 我希望它通过标准dict
通过的相同单元测试,可能还有一些修改。
我在哪里可以找到该代码?
Python 测试包含在 Python 源代码中,位于Lib/test
:
http://hg.python.org/releasing/2.7.4/file/9290822f2280/Lib/test/test_dict.py http://hg.python.org/releasing/3.3.1/file/8e5812b35480/Lib/test /test_dict.py
为了建立在 Pavel 的答案之上,看起来 python现在正在使用 mercurial
http://hg.python.org/releasing/2.7.3/file/7bb96963d067/Lib/test/test_dict.py
对于其他测试,请访问
单击releasing/<python version>
> browse
(在左侧菜单上)> 导航到相应的测试。hg.python.org 的结构类似于 svn.python.org。