1
我有具有以下目录结构的项目:配置pytest rootdir?
.
..
core/start.py
tests/test_curve.py
pytest.ini
pytest.ini的内容是:
[pytest]
testpaths = tests
的test_curve.py
内容是:
import core.start
def test_curve():
assert some_valid_stuff
当我跑项目的根文件夹pytest,我得到:
import core.start
ImportError: No module named 'core'
我在做什么错?
这不是pytest问题,但蟒蛇进口。 'core'和'tests'不是来自同一个软件包,所以你不能''import core.start' from'core import start' – Arount