跳转到主要内容

pytest平台标记,用于跳过特定平台的测试

项目描述

See Build Status on Travis CI See Build Status on AppVeyor

pytest平台标记,用于跳过特定平台的测试


特性

此插件为pytest添加以下标记:

  • posix:在POSIX操作系统(Linux/OS X,os.name != 'posix')上跳过

  • windows:在Windows(os.name != 'nt')上跳过

  • linux:在Linux(sys.platform.startswith('linux'))上跳过

  • osx:在OS X(sys.platform != 'darwin')上跳过

  • not_osx:在OS X(sys.platform == 'darwin')上跳过

  • not_frozen:在冻结时跳过(getattr(sys, 'frozen', False)

  • frozen:在非冻结时跳过(not getattr(sys, 'frozen', False)

  • ci:在CI系统上跳过('CI' not in os.environ

  • not_ci:在CI系统上跳过('CI' in os.environ

安装

您可以通过pytest-platform-markerspipPyPI 安装。

$ pip install pytest-platform-markers

贡献

欢迎贡献。可以使用 tox 运行测试,请确保在提交拉取请求之前覆盖率至少保持不变。

变更

v1.0.0

  • 添加了对 pytest >= 4.0 的支持

  • 添加了对 Python 3.6 和 3.7 的支持

  • 弃用了对 pytest < 3.6 的支持

  • 弃用了对 Python 3.3 和 3.4 的支持

v0.1.0

  • 首次发布

许可证

在 MIT 许可证的条款下分发,"pytest-platform-markers" 是免费的开放源代码软件

问题

如果您遇到任何问题,请提供详细描述并 提交一个问题

支持者