2024-09-20 22:52:51 发布
网友
运行此代码时:
from unittest import * class TestSomething(TestCase): def test_thing(self): assert True if __name__ == '__main__': main()
我得到属性错误:
我在win32上使用python3.7.0b4(v3.7.0b4:eb96c37699,2018年5月2日,19:02:22)[MSC v.1913 64位(AMD64)]。 有人能帮忙吗?在
我无法解释原因,但如果我像下面这样更新你的代码,它会按预期工作。我只是遵循了文档示例1:1,但是使用了您的类代码。在
import unittest class TestSomething(unittest.TestCase): def test_thing(self): assert True if __name__ == '__main__': unittest.main()
输出:
我无法解释原因,但如果我像下面这样更新你的代码,它会按预期工作。我只是遵循了文档示例1:1,但是使用了您的类代码。在
输出:
^{pr2}$相关问题 更多 >
编程相关推荐