1 Star 0 Fork 0

常春藤 / pytest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT
pytest
Code coverage Status https://travis-ci.org/pytest-dev/pytest.svg?branch=master https://dev.azure.com/pytest-dev/pytest/_apis/build/status/pytest-CI?branchName=master

The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries. (pytest框架使编写小型测试变得容易,但是可以扩展以支持应用程序和库的复杂功能测试。)

An example of a simple test:

# content of test_sample.py
def inc(x):
    return x + 1


def test_answer():
    assert inc(3) == 5

To execute it:

$ pytest
============================= test session starts =============================
collected 1 items

test_sample.py F

================================== FAILURES ===================================
_________________________________ test_answer _________________________________

    def test_answer():
>       assert inc(3) == 5
E       assert 4 == 5
E        +  where 4 = inc(3)

test_sample.py:5: AssertionError
========================== 1 failed in 0.04 seconds ===========================

Due to pytest's detailed assertion introspection, only plain assert statements are used. See getting-started for more examples. (由于“pytest”的详细断言内省,只使用了简单的“assert”语句。请参见“入门<https://docs.pytest.org/en/latest/getting started.html”我们的第一次测试运行>``。)

Features(特征)

  • Detailed info on failing assert statements (no need to remember self.assert* names);

(关于失败的“assert语句”的详细信息(不需要记住“self.assert*”名称);)

(可以运行“unittest<https://docs.pytest.org/en/latest/unittest.html>`(或trial),`nose<https://docs.pytest.org/en/latest/nose.html>``开箱即用的测试套件;)

  • Python 3.5+ and PyPy3;
  • Rich plugin architecture, with over 315+ external plugins and thriving community;

(丰富的插件架构,拥有超过315个“外部插件”和欣欣向荣的社区;)

Documentation(文档)

For full documentation, including installation, tutorials and PDF documents, please see https://docs.pytest.org/en/latest/. (有关完整的文档,包括安装、教程和PDF文档,请参见https://docs.pytest.org/en/latest/。)

Bugs/Requests(错误/请求)

Please use the GitHub issue tracker to submit bugs or request features. (请使用“GitHub issue tracker<https://GitHub.com/pytest dev/pytest/issues>``提交错误或请求功能。)

Changelog(变更日志)

Consult the Changelog page for fixes and enhancements of each version. (请参阅“Changelog<https://docs.pytest.org/en/latest/Changelog.html>``页面,了解每个版本的修复和增强。)

Support pytest(支持pytest)

Open Collective is an online funding platform for open and transparent communities. It provide tools to raise money and share your finances in full transparency. (`“开放集体”是一个开放透明社区的在线融资平台。它提供了筹集资金和完全透明地分享财务的工具。)

It is the platform of choice for individuals and companies that want to make one-time or monthly donations directly to the project. (它是个人和公司选择的平台,希望一次性或每月直接向项目捐款。)

See more datails in the pytest collective.

pytest for enterprise (企业版pytest)

Available as part of the Tidelift Subscription. (作为Tidelift订阅的一部分提供。)

The maintainers of pytest and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. (pytest和数千个其他软件包的维护人员正在与Tidelift合作,以提供商业支持和维护用于构建应用程序的开放源代码依赖项。 节省时间、降低风险和改善代码运行状况,同时向维护者支付使用的确切依赖项的费用。)

Learn more.

Security (安全)

pytest has never been associated with a security vunerability, but in any case, to report a security vulnerability please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure. (pytest从未与安全漏洞关联,但无论如何,要报告安全漏洞请使用“Tidelift security contact<https://Tidelift.com/security>`”。 Tidelift将协调修复和披露。)

License (许可证)

Copyright Holger Krekel and others, 2004-2019. (版权所有Holger Krekel等人,2004-2019年。)

Distributed under the terms of the MIT license, pytest is free and open source software. (pytest是根据“MIT”许可证的条款发布的,是免费的开源软件。)

The MIT License (MIT) Copyright (c) 2004-2019 Holger Krekel and others Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Python 世界中最火的第三方单元测试框架:pytest。The pytest framework makes it easy to write small tests, yet scales to support complex functional testing https://pytest.org。(pytest框架使编写小型测试变得容易,同时支持复杂的功能测试https://pytest.org) 展开 收起
Python
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/songcqs/pytest.git
git@gitee.com:songcqs/pytest.git
songcqs
pytest
pytest
master

搜索帮助