我已经在conda中安装了python。在
pytest --version
This is pytest version 3.0.5, imported from /home/fabiano/anaconda3/lib/python3.6/site-packages/pytest.py
我的测试脚本
^{pr2}$我已经导入了pytest
import pytest
我在试一些东西pytest。但是当我尝试使用pythonshell时,我会遇到这样的问题
testset.py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'testset' is not defined
在我的壳里 pytest公司
<module 'pytest' from '/home/fabiano/anaconda3/lib/python3.6/site-packages/pytest.py'>
我应该在哪里存钱测试集.py文件?在
pytest执行测试发现。基本步骤列在它们的documentation中
test_*.py
或*_test.py
。在def test_*
要进行测试,请将以下代码放入文件
test_set.py
:导航到包含文件
^{pr2}$test_set.py
的目录并执行pytest命令:预期产量:
相关问题 更多 >
编程相关推荐