我有以下目录结构
pytest_testing/
__init__.py
math_ops.py
dbs/
__init__.py
dbConnect.py
tests/
test1.py
现在在test1.py中,我试图从dbConnect模块导入一个函数,就像这样from pytest_testing.dbs.dbConnect import query_data
,但是我得到错误“No module named pytest_testin”。在
如果我在pytest_上面的目录中尝试同样的方法,测试一切都会很好。我是不是少了点什么?在
如果您使用Linux或Windows,请使用以下代码:
好吧,你可以输入这个
from dbs.dbConnect import query_data
。 我认为这可以很好地工作相关问题 更多 >
编程相关推荐