我正在使用python,而且对它还不熟悉。我正在尝试为我的类方法编写单元测试,其中我们使用configparse获取位于特定路径的配置文件详细信息
在进行单元测试时,它会给我一个错误作为<;位于0x000001E8AEBC1F40处的configparser.configparser对象>
configparser的代码如下
algor_conf = configparser.ConfigParser()
self.algor_conf.read('./path')
self.algor_conf['DynamicProgramingParamaters']['wealth_state_total']
有人能帮我嘲笑一下吗
这里有一些解决方案。您可以自由选择最适合您需要的6个选项(命名为
test_mock1
到test_mock6
)src.py
test\u src.py
输出
相关问题 更多 >
编程相关推荐