# pytest-examples **Repository Path**: steeed/pytest-examples ## Basic Information - **Project Name**: pytest-examples - **Description**: pytest 官网 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-03-09 - **Last Updated**: 2022-04-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: 学习 ## README pytest examples --------------- #### 介绍 pytest 官网 #### 软件架构 软件架构说明 #### 安装教程 1. 创建虚拟环境 ```bash python -m venv .venv source .venv/bin/activate ``` 2. pip 安装依赖库 ```bash python -m pip install -U pip python -m pip install -r requirements.txt ``` 3. 检查版本信息 ```console $ pytest --version pytest 7.0.1 ``` #### Features 特性 - Detailed info on failing [assert statements](https://docs.pytest.org/en/7.0.x/how-to/assert.html#assert) (no need to remember self.assert* names) - 失败的断言有详细的信息(不用记各种self.assert\*,对标unittest模块) - [Auto-discovery](https://docs.pytest.org/en/7.0.x/explanation/goodpractices.html#test-discovery) of test modules and functions - 自动发现测试 - [Modular fixtures](https://docs.pytest.org/en/7.0.x/reference/fixtures.html) for managing small or parametrized long-lived test resources - 模块化的 fixtures,用于管理小型的或参数化的长生命周期的测试资源 - Can run unittest (including trial) and nose test suites out of the box - 可以开箱即用的运行其他模块编写的测试套件 - Python 3.6+ and PyPy 3 - Rich plugin architecture, with over 800+ external plugins and thriving community - 丰富的插件和繁荣的社区 #### Documentation 文档 1. [Get started](https://docs.pytest.org/en/7.0.x/getting-started.html#get-started) - install pytest and grasp its basics just twenty minutes 2. [How-to guides](https://docs.pytest.org/en/7.0.x/how-to/index.html#how-to) - step-by-step guides, covering a vast range of use-cases and needs 3. [Reference guides](https://docs.pytest.org/en/7.0.x/reference/index.html#reference) - includes the complete pytest API reference, lists of plugins and more 4. [Explanation](https://docs.pytest.org/en/7.0.x/explanation/index.html#explanation) - background, discussion of key topics, answers to higher-level questions