我试图在我的Python代码上运行doctest
。你知道吗
我用这个来运行doctest
import doctest
doctest.testfile("test.txt", verbose=True)
test.txt
文件如下所示:
print("hello")
hello
from filetotest import *
print("hello")
hello
我的问题是,在第3行from filetotest import *
之后,doctest停止运行doctest
Trying:
print("hello")
Expecting:
hello
ok
Trying:
from filetotest import *
Expecting nothing
因此,在我尝试从filetotest
导入函数后,doctest
不要尝试文件中的其余函数,我要做的是测试filetotest
中的函数。你知道吗
怎么了,为什么停了?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐