如何在setuptools的pyproject.toml中定义pytest插件?
等效的pyproject.toml写法
对应你提供的setup.py中的entry_points配置,在pyproject.toml里可以用以下两种写法实现等效效果:
写法一:键值对形式
[project.entry-points."pytest11"] copie = "pytest_copi.plugin"
写法二:数组形式
[project.entry-points] pytest11 = [ "copie = pytest_copi.plugin", ]
两种写法都能将你的pytest插件正确注册到pytest11这个entry points组中,满足pytest官方对插件注册的要求。
内容的提问来源于stack exchange,提问作者Pierrick Rambaud
相关产品推荐
相关产品推荐

