PyCharm之pytest测试基本框架
一.pytest基本使用
1.安装pytest
pip install pytest
2.pytest用法
1.在PyCharm中创建文件为:test_go.py,写入代码
# -*- coding: utf-8 -*
def test_1():
assert 1==1 #断言
2,运行有两种方法
1,主函数运行:
# -*- coding: utf-8 -*
import pytest
def test_1():
assert 1==1
if __name__ == '__main__':
pytest.main()
2,pycharm的命令窗口输入pytest
注 D:\liu 是需要测试文件的目录位置
3.pytest基础功能
# -*- coding: utf-8 -*-
from selenium