[PyCharm]pytest设置和使用¶
PyTest
使用参考pytest
设置¶
点击菜单栏 -> File -> Settings
,选择Tools->Python Integrated Tools
,在Testing
选项中选择pytest
使用¶
编辑测试文件后,在编辑区域右键选择Run "pytest for xxx"
如果不存在,需要额外创建运行配置,点击Edit Configuration
点击左上角+
符号,创建一个新的配置
- 选择
pytest
作为执行命令 - 选择要执行的文件路径