Pytest测试结构导入

时间:2018-02-07 01:43:37

标签: python pytest

我想使用step!(integrator)进行测试。正如我所读到的,最好有以下结构:

pytest

在我的档案project/ home.py tests/ test_home.py 中,我有:

test_home.py

如何导入import pytest 进行测试?

1 个答案:

答案 0 :(得分:0)

如果要使用上面提到的项目结构运行pytest,您需要在tests目录中有一个__init__.py文件。还要确保从项目目录运行pytest。

相关问题