系列文章目录

提示:阅读本章之前,请先阅读目录

文章目录

系列文章目录前言一、创建项目二、安装pdm三、使用pdm创建项目四、创建src五、src下面,再创建包名六、编写plugin七、编写配置pyproject.toml八、使用pdm,添加pytest到该插件包九、打包,pdm build十、另外一个项目,安装该插件包十一、另外一个项目,编写好pytest测试用例更新日志

前言

一、创建项目

二、安装pdm

三、使用pdm创建项目

命令行:pdm init

四、创建src

五、src下面,再创建包名

六、编写plugin

def pytest_configure():

print("之前,我被执行啦~~~~")

def pytest_unconfigure():

print("之后,我被执行啦~~~~")

七、编写配置pyproject.toml

[project.entry-points.pytest11]

result_log = "pytest_smobee.plugin"

[tool.pdm.build]

package-dir = "src"

八、使用pdm,添加pytest到该插件包

命令行:pdm add pytest

九、打包,pdm build

打包完成之后,在dist目录下面

十、另外一个项目,安装该插件包

命令行:pip install 反之,卸载是 pip uninstall

十一、另外一个项目,编写好pytest测试用例

命令行:pytest -s 执行

更新日志

好文推荐

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: