环境配置
使用Pipenv进行虚拟环境管理,Pipfile为依赖模块管理文件。
- 安装pipenv:brew install pipenv
- 根项目根目录下执行命令创建虚拟环境: pipenv install
- 在Pycharm中指定项目运行的虚拟环境 :File->Settings->Project:->Project Interpreter
执行用例
- 配置PyCharm的default test runner为pytest
- 打开PyCharm的run/debug configurations窗口,指定运行文件
- pytest.ini文件中指定配置的config文件
- 运行