百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pytest

> 测试质量
开源

Pytest 框架使得写作小测试变得容易,然而天平支持复杂的功能测试

14.4K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Pytest 框架使得写作小测试变得容易,然而天平支持复杂的功能测试

. 图像: https://github.com/pytest-dev/pytest/raw/main/doc/en/img/pytest_logo_curves.svg 目标:https://docs.pytest.org/en/stable/ : 对齐: 中心 :高:200 : 备选案文: pytest


.图像: https://img.shields.io/pypi/v/pytest.svg 目标:https://pypi.org/project/pytest/

.图像: https://img.shields.io/conda/vn/conda-forge/pytest.svg 目标:https://anaconda.org/conda-forge/pytest

.图像:https://img.shields.io/pypi/pyversions/pytest.svg 目标:https://pypi.org/project/pytest/

.图像:https://codecov.io/gh/pytest-dev/pytest/branch/main/graph/badge.svg 目标:https://codecov.io/gh/pytest-dev/pytest : 备选案文:代码覆盖

.图像:https://github.com/pytest-dev/pytest/actions/workflows/test.yml/badge.svg 目标:https://github.com/pytest-dev/pytest/actions?query=workflow%3Atest

.图像: https://results.pre-commit.ci/badge/github/pytest-dev/pytest/main.svg 目标:https://results.pre-commit.ci/latest/github/pytest-dev/pytest/main :alt:预承诺.ci状态

.图像:ZZURL14Z 目标:https://www.codetriage.com/pytest-dev/pytest

.图像: https://readthedocs.org/projects/pytest/badge/?version=latest 目标:https://pytest.readthedocs.io/en/latest/?badge=latest : 备选案文:文档状态

.图像: https://img.shields.io/badge/Discord-pytest--dev-blue 目标:https://discord.com/invite/pytest-dev : alt: 迪斯科尔

.图像:https://img.shields.io/badge/Libera%20chat-%23pytest-orange 目标:https://web.libera.chat/#pytest : alt: Libera 聊天

"pytest"的框架使得写小测试变得容易,然而 为应用程序和库支持复杂功能测试的天平。

简单测试的例子:

密码:Python

测试内容 sample.py

f inc(x) 数据: 返回x+1时

def 测试 答案( ): 坚持inc(3) == 5

要执行它:

测试美元 QQ 测试会话开始QQ 收缴1件物品

测试 sample.py F

================================== 错误 页:1

Issues· 844 开放

查看全部 Issues在 GitHub 打开
  • #15067

    在`cached_result`被赋值之前中断设置时,将跳过固定器最终化程序

    更新于 2026年10月1日
  • #15097

    当警告类别不相关时,`WarningsRecorder.pop()` 返回最后一条匹配,而不是第一条

    更新于 2026年10月1日
  • #15099

    monkeypatch.setattr 在具有自定义 __setattr__ 的对象上无法撤销 (来自 #14969 的回归)

    更新于 2026年10月1日
  • #13817

    在 `pytest_addoption` 中添加了无效标志的 `AttributeError`

    type: bug更新于 2026年9月28日
  • #14853

    将 FixtureFunctionDefinition 定义为公共 API 的一部分

    good first issuetopic: fixtures更新于 2026年9月27日
  • #13327

    doctest 选项 NUMBER 和 ELLIPSIS 似乎不兼容

    plugin: doctests更新于 2026年9月25日
  • #14186

    将 CaptureManager 当作公共 API 进行暴露

    type: enhancementtype: feature-branch更新于 2026年9月24日
  • #13750

    `Unicode EncodeError' in 插件中,在参数化和`-调试'中带有替代逃生装置

    topic: parametrizetopic: collection更新于 2026年9月24日
  • #13045

    考虑采用开放式测试报告格式

    status: help wantedtype: proposal更新于 2026年9月24日
  • #8079

    设置时长的分解

    type: proposaltopic: reportingtopic: fixtures更新于 2026年9月24日

> 标签

Pythonhacktoberfestpythontesttesting

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年10月1日
分类测试质量
定价开源

> 相关工具

J
Jest
JavaScript 测试框架
P
Playwright
现代端到端测试框架
E
eslint-plugin-test-selectors
Enforces that data-test-id attributes are added to interactive DOM elements (JSX) to help with UI testing. JSX only.