使用unittest.mock.patch时,为什么autospec默认不是True?
问题描述当您使用 mock 修补函数时,您可以选择将 autospec 指定为 True: When修补类会产生“AttributeError:Mock object has no attribute";访问实例属性时
问题描述问题将 mock.patch 与 autospec=True 一起使用来修补类不会保留该类实- 0
- 0
- 0
- 0
- 0
| 文章分类: |
|
上传中....
使用unittest.mock.patch时,为什么autospec默认不是True?
问题描述当您使用 mock 修补函数时,您可以选择将 autospec 指定为 True: When修补类会产生“AttributeError:Mock object has no attribute";访问实例属性时
问题描述问题将 mock.patch 与 autospec=True 一起使用来修补类不会保留该类实