当前位置: 首页 > news >正文

女装市场网站建设费用评估城市门户网站策划书

女装市场网站建设费用评估,城市门户网站策划书,搜索关键词的网站,东莞个人网站推广建设默认情况下#xff0c;pytest 使用pytest.Package来收集包含 __init__.py 文件的目录#xff0c;使用 pytest.Dir来收集其他目录。如果你想要自定义目录的收集方式#xff0c;你可以编写自己的pytest.Directory 收集器#xff0c;并使用 pytest_collect_directory钩子来连接…默认情况下pytest 使用pytest.Package来收集包含 __init__.py 文件的目录使用 pytest.Dir来收集其他目录。如果你想要自定义目录的收集方式你可以编写自己的pytest.Directory 收集器并使用 pytest_collect_directory钩子来连接它。 对于目录清单文件的一个基本示例 假设你想要自定义每个目录的收集方式。以下是一个conftest.py插件的示例它允许目录包含一个manifest.json文件该文件定义了该目录的收集方式。在这个示例中仅支持一个简单的文件列表但你可以想象添加其他键如排除项和通配符。 from __future__ import annotations import json import pytest class ManifestDirectory(pytest.Directory): def collect(self): # pytest的标准行为是遍历所有test_*.py文件并对每个文件调用pytest_collect_file。 # 这个收集器改为读取manifest.json文件并且仅对其中定义的文件调用pytest_collect_file。 manifest_path self.path / manifest.json manifest json.loads(manifest_path.read_text(encodingutf-8)) ihook self.ihook for file in manifest[files]: yield from ihook.pytest_collect_file( file_pathself.path / file, parentself ) pytest.hookimpl def pytest_collect_directory(path, parent): # 对于包含manifest.json文件的目录使用我们的自定义收集器。 if path.joinpath(manifest.json).is_file(): return ManifestDirectory.from_parent(parentparent, pathpath) # 否则回退到标准行为。 return None 你可以创建一个 manifest.json 文件和一些测试文件 {files: [test_first.py,test_second.py] } # content of test_first.py from __future__ import annotationsdef test_1():pass # content of test_second.py from __future__ import annotationsdef test_2():pass # content of test_third.py from __future__ import annotationsdef test_3():pass 现在你可以执行测试规范了: customdirectory $ pytesttest session starts platform linux -- Python 3.x.y, pytest-8.x.y, pluggy-1.x.y rootdir: /home/sweet/project/customdirectory configfile: pytest.ini collected 2 itemstests/test_first.py . [ 50%] tests/test_second.py . [100%] 2 passed in 0.12s 请注意test_three.py 没有被执行因为它没有在清单中列出。 你可以验证你的自定义收集器是否出现在收集树中 customdirectory $ pytest --collect-onlytest session starts platform linux -- Python 3.x.y, pytest-8.x.y, pluggy-1.x.y rootdir: /home/sweet/project/customdirectory configfile: pytest.ini collected 2 itemsDir customdirectoryManifestDirectory testsModule test_first.pyFunction test_1Module test_second.pyFunction test_2 2 tests collected in 0.12s
http://www.w-s-a.com/news/535738/

相关文章:

  • 咸阳做网站开发公司哪家好珠海公司制作网站
  • 深圳网站建设好不好医疗网站前置审批
  • 做ic什么网站好安溪网站建设
  • 网站建设 慕课企业文化标语经典
  • 做短视频的网站都有哪些简约 时尚 高端 网站建设
  • 浦口区网站建设售后服务建设一个网站多少钱
  • 做个小网站大概多少钱广州h5网站
  • 360免费建站视频wordpress标签显示图片
  • 创建简易个人网站国外做网站被动收入
  • 轻定制网站建设网页培训哪个机构好
  • 青岛海诚互联做网站好吗计算机软件开发培训机构
  • 德钦网站建设如何在网站上做用工登记
  • 创意品牌网站云服务
  • 个人备案网站可以做商城展示如何制作网页二维码
  • 网站建设php教程视频百度seo 站长工具
  • 外包小程序两个相同的网站对做优化有帮助
  • 网站备案主体修改wordpress 导航图片
  • 怎么建设网站数据库用vs代码做网站
  • 运营企业网站怎么赚钱动漫制作专业概念
  • 宜春网站建设推广网络推广工作好干吗
  • 网站程序0day平顶山市做网站
  • 企业网站名称怎么写哔哩哔哩网页版官网在线观看
  • 直播网站建设书籍阿里巴巴网站建设销售
  • 肇庆企业自助建站系统郴州网站建设解决方案
  • 长沙专业做网站排名游戏开发大亨内购破解版
  • 网站推广适合女生做吗网站如何开启gzip压缩
  • 做外单阿里的网站建站平台那个好
  • 全国性质的网站开发公司关于网站开发的请示
  • 齐齐哈尔住房和城乡建设局网站生物科技公司网站模板
  • 中国建设协会官方网站前端培训的机构