python - Python 3.4 功能需要哪个版本的 ‘unittest2’?

标签 python python-2.7 python-unittest backport

new features in Python 3.4's unittest 需要什么版本的 unittest2 库?

第三方unittest2 library是 Python 3 的 unittest 功能的一个非常有用的向后移植,可以在较旧的 Python 版本上工作。通过导入该第三方库,您可以在 Python 2 代码中使用 Python 3 的 unittest 描述的功能。

有一些handy new features在 Python 3.4 的 unittest 库中。 (特别是,我尝试以一种在我们迁移到 Python 3 时继续工作的方式使用“子测试”功能。)

要在 Python 2 中使用这些功能,我需要安装什么版本的 unittest2

最佳答案

我在存储库中做了一些挖掘,它看起来像:

我根本找不到任何关于 mock() 的提交,所以我只能假设它不可用或不维护。否则,您想要的所有内容都是 0.6.0 或更高版本(但我建议您无论如何都获取最新版本)。

关于python - Python 3.4 功能需要哪个版本的 ‘unittest2’?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38584080/

相关文章:

python - 如何了解quadpack使用的集成技术

Python:logging.streamhandler 没有将日志发送到标准输出

python - 区分字典和字典列表的 pythonic 方法是什么?

python - Qlocale 和巴西货币格式

python - Python 2 中的 K.<v> 表示法

类的python模拟默认初始化参数

python - Pygame 向各个方向射击

python - Python 2.7 中的断言对我不起作用示例 assertIn

ipython - IPython中的单元测试输出

python - 从多个测试用例创建测试套件